Spyder: Can't initialize, ImportError: InteractiveConsole

Created on 19 Jul 2017  路  2Comments  路  Source: spyder-ide/spyder

Description of your problem

Spider says that it crashed the last time it was used, and asks me to --reset to solve the error I'm getting. I've tried --reset, uninstalling and reinstalling, updating, and I still cannot initialize spyder from the mac terminal command line as I usually do. It's an installation from within conda.

What steps will reproduce the problem?

I'm not sure what caused this problem to happen. Whenever I try to

  1. Initialize spyder from the mac terminal

I encounter this problem.

What is the expected output? What do you see instead?
Expect to open the spyder GUI, instead get a pop up window with an error message the first time I try, saying:

Spyder crashed during last session.

If Spyder does not start at all and before submitting a bug report, please try to reset settings to defaults by running Spyder with the command line option '--reset':
python spyder --reset

Warning: this command will remove all your Spyder configuration files located in '$HOME/.spyder').

If restoring the default settings does not help, please take the time to search for known bugs or discussions matching your situation before eventually creating a new issue here. Your feedback will always be greatly appreciated.

and then I reset it, and get only error messages in the mac terminal console the next times I try.

from spyder.interpreter import Interpreter

File "$HOME/anaconda/lib/python2.7/site-packages/spyder/interpreter.py", line 19, in
from code import InteractiveConsole
ImportError: cannot import name InteractiveConsole

Versions and main components

  • Spyder Version: 3.1.4
  • Python Version: 2.7
  • Operating system: MAC OSX 10.11.6

Most helpful comment

from code import InteractiveConsole
ImportError: cannot import name InteractiveConsole

My guess is that you somewhere have file called a code.py and that this file interferes with the code module in Python's standard library which is used by Spyder. If this is the case, then you may find the file by running import code and print(code) from a Python console.

All 2 comments

from code import InteractiveConsole
ImportError: cannot import name InteractiveConsole

My guess is that you somewhere have file called a code.py and that this file interferes with the code module in Python's standard library which is used by Spyder. If this is the case, then you may find the file by running import code and print(code) from a Python console.

That is fantastic. I had indeed pulled from a repository in which someone added a file named code.py. I got rid of the repository altogether, and now Spyder is back. Thank you so much.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Khalilsqu picture Khalilsqu  路  3Comments

marianux picture marianux  路  3Comments

yogu220172 picture yogu220172  路  3Comments

JesterEE picture JesterEE  路  3Comments

gabrielclow picture gabrielclow  路  3Comments