TAGS :Viewed: 6 - Published at: a few seconds ago

[ Python Spyder reset ]

I was using python(x,y), which came with Spyder. Yesterday, Spyder crashed I can't figure it out how to fix it. I uninstalled python(x,y) and reinstalled, still the same problem.

If I try to open Spyder I get this message:

Spyder crashed during last session

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

python spyder --reset

Of course, I tried to do the above, but it doesn't seem like I have Spyder in my path. When I try to put

python spyder --reset

in my command prompt window, I get this error message:

python: can't open file 'spyder': [Errno 2] No such file or directory

I made some attempts of trying to add spyder to path, but they all failed. How should I go about adding Spyder to path?

I am using Windows Vista on a 32 bit system.

My Spyder Crash report looks like this:

Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\spyderlib\spyder.py", line 1547, in main
    mainwindow = run_spyder(app, options)
  File "C:\Python27\lib\site-packages\spyderlib\spyder.py", line 1472, in run_spyder
  File "C:\Python27\lib\site-packages\spyderlib\spyder.py", line 555, in setup
  File "C:\Python27\lib\site-packages\spyderlib\plugins\console.py", line 54, in __init__
  File "C:\Python27\lib\site-packages\spyderlib\widgets\internalshell.py", line 101, in __init__
    debug, profile)
  File "C:\Python27\lib\site-packages\spyderlib\widgets\shell.py", line 698, in __init__
    ShellBaseWidget.__init__(self, parent, history_filename, debug, profile)
  File "C:\Python27\lib\site-packages\spyderlib\widgets\shell.py", line 61, in __init__
    self.history = self.load_history()
  File "C:\Python27\lib\site-packages\spyderlib\widgets\shell.py", line 500, in load_history
    if rawhistory[1] != self.INITHISTORY[1]:
IndexError: list index out of range

I am terrible with this stuff, so I might be missing something completely obvious or doing something really stupid.

I am wondering if anyone else ran into a similar problem, or can just give suggestions on what to do, and how to do this "reset" thing, or maybe other advice.

Thank You in Advance

Answer 1

python doesn't search spyder in the PATH e.g.:

c:\some\dir> python some_file

Here python tries to read c:\some\dir\some_file file i.e., it looks in the current directory for some_file file.

c:\some\dir> python another_dir\some_file

Here python tries to read c:\some\dir\another_dir\some_file file i.e., it looks in the another_dir directory for some_file file.

c:\some\dir> python C:\path\to\some_file

Here python tries to read C:\path\to\some_file file i.e., it looks in the C:\path\to directory.

If documentation says run: python spyder --reset it assumes that you're in the directory where spyder script lives. It works both from the source checkout scripts directory (if you'd like to run it without installation) and from whatever directory the installation puts scripts in.

Installation process should create spyder or spyder.bat files. If spyder.bat in your PATH then you could run it as:

c:\any\dir> spyder

So instead of python spyder --reset you could try:

c:\any\dir> spyder --reset

The traceback shows that the first executed function is spyderlib.spyder.main(), source code for the spyder script confirms it, so you can run:

python -c "from spyderlib.spyder import main; main()" --reset

Answer 2

Searched for spyder.bat, per prev answer, and after changing to that directoy - ran the python spyder --reset command.

C:\WinPython-32bit-\python-2.7.3>cd scripts
C:\WinPython-32bit-\python-2.7.3\Scripts>python spyder --reset

Answer 3

I had a similar problem. I had both two installations of Python27---the Ananaconda distribution and the other. Python27 folders appeared before the Anaconda ones in my search path, although Spyder was executed through the Anaconda executable.

It turned out that making the Anaconda distribution folders first in the PYTHONPATH solved the problem.

An easier solution--avoid multiple installations of Python27 if possible.

Answer 4

I have this problem in windows and it resolved by updating the spyder

pip install -U spyder