Spyder: cannot import name InteractiveConsole

Created on 17 Dec 2017  路  6Comments  路  Source: spyder-ide/spyder

When trying to open spyder from terminal ubuntu, I get the following error:

Traceback (most recent call last):
File "/home/lemma/anaconda2/lib/python2.7/site-packages/spyder/app/mainwindow.py", line 3099, in main
mainwindow = run_spyder(app, options, args)
File "/home/lemma/anaconda2/lib/python2.7/site-packages/spyder/app/mainwindow.py", line 3001, in run_spyder
main.setup()
File "/home/lemma/anaconda2/lib/python2.7/site-packages/spyder/app/mainwindow.py", line 815, in setup
from spyder.plugins.console import Console
File "/home/lemma/anaconda2/lib/python2.7/site-packages/spyder/plugins/console.py", line 35, in
from spyder.widgets.internalshell import InternalShell
File "/home/lemma/anaconda2/lib/python2.7/site-packages/spyder/widgets/internalshell.py", line 27, in
from spyder.interpreter import Interpreter
File "/home/lemma/anaconda2/lib/python2.7/site-packages/spyder/interpreter.py", line 19, in
from code import InteractiveConsole
ImportError: cannot import name InteractiveConsole

Not sure what happen but the temporary fix is to always type: spyder --reset, which is inconvenient, especially after setting PYTHONPATH in the spyder console.

Versions and main components

  • Spyder Version: 3.24
  • Python Version: 2.7
  • Qt Version: 5.6.2
  • Operating system: Ubuntu 14.04

Dependencies

IPython >=4.0;<6.0: 5.4.1 (OK)
cython >=0.21 : 0.27.3 (OK)
jedi >=0.9.0 : 0.10.2 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
numpy >=1.7 : 1.11.2 (OK)
pandas >=0.13.1 : 0.20.3 (OK)
psutil >=0.3 : 5.4.0 (OK)
pycodestyle >=2.3 : 2.3.1 (OK)
pyflakes >=0.5.0 : 1.5.0 (OK)
pygments >=2.0 : 2.2.0 (OK)
pylint >=0.25 : 1.7.4 (OK)
qtconsole >=4.2.0 : 4.3.1 (OK)
rope >=0.9.4 : 0.10.5 (OK)
sphinx >=0.6.6 : 1.6.3 (OK)
sympy >=0.7.3 : 1.1.1 (OK)

NotSpyder

Most helpful comment

Do you have a file called code that you are adding through PYTHONPATH?

All 6 comments

UPDATE:
Ok now even spyder --reset cannot open spyder IDE.
I have re-installed everything though...

Do you have a file called code that you are adding through PYTHONPATH?

Possible duplicate of #4770

Ok I have the file named code, not code.py but after changing the folder name to something else, spyder running again normal. THX!!

Great to hear!

Do you have a file called code that you are adding through PYTHONPATH?

It鈥檚 my problem. I create a python script named 'code'. Now I rename it with 'Code'. There no error!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

goanpeca picture goanpeca  路  3Comments

zaroth picture zaroth  路  3Comments

hedeqing picture hedeqing  路  3Comments

spyder-bot picture spyder-bot  路  3Comments

gabrielclow picture gabrielclow  路  3Comments