Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Data Science by (18.4k points)

I am using spyder and it got crashed so I tried to fix it but couldn't do it.

So I finally uninstall the spyder and reinstalled it again but I am getting the same problem again.

When I open the Spyder I am getting the below 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

I tried running the code in the command prompt window as the command was displayed in the message :

python spyder --reset

But I am getting another error telling:

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

I added the path to Spyder several times but failed. I am using the Windows 32 bit system and the crash repost of the Spyder 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

    main.setup()

  File "C:\Python27\lib\site-packages\spyderlib\spyder.py", line 555, in setup

    multithreaded=self.multithreaded)

  File "C:\Python27\lib\site-packages\spyderlib\plugins\console.py", line 54, in _init_

    light_background=light_background)

  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

Any help will be appreciated.

1 Answer

0 votes
by (36.8k points)

Python doesn't search spyder in the PATH for example"

c:\some\dir> python some_file

Here python tries to read c:\some\dir\some_file file i.e., it looks into a 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 you observe in the message the Spyder is telling to run the command:

python spyder --reset

Because it is assuming that you are present in the spyder script lives. It also works from the source script directory.

When you install you should create Spyder to Spyder.bat files. In case Spyder.bat is present then run as it is

c:\any\dir> spyder

Instead of python spyder --reset you can try:

c:\any\dir> spyder --reset

At last, you can run the command:

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

I hope this will help you.

Improve your knowledge in data science from scratch using data scientist

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked May 9, 2020 in Data Science by blackindya (18.4k points)
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...