Parseltongue
Parseltongue

Reputation: 11667

Error when upgrading Spyder to 4.0.1: ModuleNotFoundError: No module named 'IPython.core.inputtransformer2'

I recently upgraded to Spyder 4.0.1 through Anaconda via conda update spyder. Now, when I try to boot up Spyder via Anaconda Navigator, the program automatically crashes with the following dump:

Traceback (most recent call last):
File "/Users/ed/anaconda/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 3718, in main
mainwindow = run_spyder(app, options, args)
File "/Users/ed/anaconda/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 3559, in run_spyder
main.setup()
File "/Users/ed/anaconda/lib/python3.6/site-packages/spyder/app/mainwindow.py", line 1010, in setup
from spyder.plugins.ipythonconsole.plugin import IPythonConsole
File "/Users/ed/anaconda/lib/python3.6/site-packages/spyder/plugins/ipythonconsole/plugin.py", line 52, in 
from spyder.plugins.ipythonconsole.widgets import ClientWidget
File "/Users/ed/anaconda/lib/python3.6/site-packages/spyder/plugins/ipythonconsole/widgets/__init__.py", line 16, in 
from .debugging import DebuggingWidget
File "/Users/ed/anaconda/lib/python3.6/site-packages/spyder/plugins/ipythonconsole/widgets/debugging.py", line 22, in 
from IPython.core.inputtransformer2 import TransformerManager
ModuleNotFoundError: No module named 'IPython.core.inputtransformer2'

I couldn't find anybody with a similar error. I updated IPython, as someone suggested, but it did not resolve the problem. Any ideas?

Upvotes: 7

Views: 8011

Answers (5)

Van Tai Nguyen
Van Tai Nguyen

Reputation: 1

I experienced the same problem. Just do conda update IPython. All good then!

Upvotes: 0

raphael
raphael

Reputation: 2970

... since none of this worked for me, here how I solved it:

  1. check what IPython version you have via conda list

    in my case i got a rather old version 5.8.0 instead of the most recent one
    (at the time of writing 7.19.0... check available versions via conda search ipython)

  2. since conda update ipython did not provide the most recent version, i decided to manually run the command that installs the most recent version
    (for me this was conda install -c conda-forge ipython=7.19.0)

  3. that's it...

Upvotes: 5

CypherCrypt
CypherCrypt

Reputation: 129

I had this very same issue on Spyder 4.1.4. Turns out that not all the required packages were installed correctly when I installed Spyder.

I used the following in python to test IPython:

import IPython
print(IPython.__version__)

Turned out that I had 6.4.0 so I ran the following from the terminal:

!pip install --upgrade IPython

IPython 7.16.1 was installed with prompt_toolkit-3.0.5. I also got the following errors:

ERROR: spyder 4.1.4 requires pyqt5<5.13; python_version >= "3", which is not installed.

ERROR: spyder 4.1.4 requires pyqtwebengine<5.13; python_version >= "3", which is not installed.

ERROR: jupyter-console 5.2.0 has requirement prompt-toolkit<2.0.0,>=1.0.0, but you'll have prompt-toolkit 3.0.5 which is incompatible.

ERROR: spyder 4.1.4 has requirement jedi==0.17.1, but you'll have jedi 0.12.1 which is incompatible.

ERROR: spyder 4.1.4 has requirement parso==0.7.0, but you'll have parso 0.3.0 which is incompatible.

ERROR: spyder 4.1.4 has requirement qtconsole>=4.6.0, but you'll have qtconsole 4.3.1 which is incompatible.

ERROR: spyder-kernels 1.9.2 has requirement ipykernel>=5.1.3; python_version > "2", but you'll have ipykernel 4.8.2 which is incompatible.

ERROR: spyder-kernels 1.9.2 has requirement jupyter-client>=5.3.4, but you'll have jupyter-client 5.2.3 which is incompatible.

Installing the correct versions of the above packages in pip resolved my problem.

Upvotes: 2

George
George

Reputation: 39

Update to python 3.7. I had the same problem. That solved it.

conda install python=3.7 anaconda=custom

Upvotes: 0

Ali Khalili
Ali Khalili

Reputation: 69

I had the same problem. Upgrading IPython via the following command line helped resolve the situation.

sudo conda update IPython -n xxx

where xxx is the name of the environment I was trying to run Spyder in.

Upvotes: 3

Related Questions