Import pretrained models fails

I am not able to run the following lines:

import torch, torchvision
model = torchvision.models.resnet18(pretrained=True)

The error is the following:

Traceback (most recent call last):
  File "/home/tamme/anaconda3/envs/deep/lib/python3.8/site-packages/IPython/terminal/", line 113, in get_completions
    yield from self._get_completions(body, offset, cursor_position, self.ipy_completer)
  File "/home/tamme/anaconda3/envs/deep/lib/python3.8/site-packages/IPython/terminal/", line 129, in _get_completions
    for c in completions:
  File "/home/tamme/anaconda3/envs/deep/lib/python3.8/site-packages/IPython/core/", line 438, in _deduplicate_completions
    completions = list(completions)
  File "/home/tamme/anaconda3/envs/deep/lib/python3.8/site-packages/IPython/core/", line 1818, in completions
    for c in self._completions(text, offset, _timeout=self.jedi_compute_type_timeout/1000):
  File "/home/tamme/anaconda3/envs/deep/lib/python3.8/site-packages/IPython/core/", line 1861, in _completions
    matched_text, matches, matches_origin, jedi_matches = self._complete(
  File "/home/tamme/anaconda3/envs/deep/lib/python3.8/site-packages/IPython/core/", line 2029, in _complete
    completions = self._jedi_matches(
  File "/home/tamme/anaconda3/envs/deep/lib/python3.8/site-packages/IPython/core/", line 1373, in _jedi_matches
    interpreter = jedi.Interpreter(
  File "/home/tamme/anaconda3/envs/deep/lib/python3.8/site-packages/jedi/api/", line 725, in __init__
    super().__init__(code, environment=environment,
TypeError: __init__() got an unexpected keyword argument 'column'

Any idea what I am doing wrong?
Thank you!

I haven’t seen this issue before and it seems that IPython and/or jedi raises it.
Could you verify that the minimal code snippet is running fine in the terminal?

Ah yes, it works without ipython, but thats still annoying…
Anyway, thanks already!

It seems the be related to this issue:

Try to downgrade jedi to 0.17.2 via:

pip install jedi==0.17.2

Yes, great, now it works fine. Thanks a lot!