5

for some reason my Python IDE spyder isn't working anymore. When trying to start it, it does not open. Trying ~$ spyder in the console gives to following error:

Traceback (most recent call last):
  File "/usr/bin/spyder", line 2, in <module>
from spyderlib import start_app
File "/usr/lib/python2.7/dist-packages/spyderlib/start_app.py", line 13, in <module>
from spyderlib.config import CONF
File "/usr/lib/python2.7/dist-packages/spyderlib/config.py", line 433, in <module>
subfolder=SUBFOLDER, backup=True, raw_mode=True)
File "/usr/lib/python2.7/dist-packages/spyderlib/userconfig.py", line 111, in __init__
self.load_from_ini()
File "/usr/lib/python2.7/dist-packages/spyderlib/userconfig.py", line 150, in load_from_ini
self.read(self.filename())
File "/usr/lib/python2.7/ConfigParser.py", line 305, in read
self._read(fp, filename)
File "/usr/lib/python2.7/ConfigParser.py", line 546, in _read
raise e
ConfigParser.ParsingError: File contains parsing errors: /home/rk/.spyder2/.spyder.ini
[line 317]: 'shor'

I have tried sudo apt-get install --reinstall spyder and even sudo apt-get purge spyder && sudo apt-get install spyder but that didn't help either. Nor did I find a solution to my problem online.

Can anyone tell me what is wrong?

4
  • You need to find & fix the error around line 317 of your /home/rk/.spyder2/.spyder.ini file: if you need help with that, please edit your post to include the relevant section of the file. Since it's a personal configuration file (in your home directory) it won't be affected by reinstalling the package. Jun 18, 2015 at 10:39
  • I did sudo gedit PATH/.spyder2.ini to take a look at line 317. It just says shor. I do, however, not know what it is supposed to say, so i don't know what to change it to. Can't i just delete the file (the entire directory) and have it recreated with a new install? Jun 18, 2015 at 12:08
  • I don't know if it works that way here, but this thread can be closed (?). I did simply delete my entire .spyder2 directory. Maybe not the most subtle solution be it worked. It was created anew when i reinstalled spyder. For some reason my entire .spyder.ini was corrupted (wrong), there were multiple lines missing at the end. Jun 18, 2015 at 12:16
  • That's fine: at worst, you may have lost any personal spyder preferences/settings that you had set. There is no reason to close the thread - feel free to add (and accept) your own solution as an answer. Jun 18, 2015 at 12:19

4 Answers 4

6

I had a related problem. Spyder (version 2.2.5) crashed. I tried to reopen it after rebooting my computer, but nothing happened- clicking on the symbol in the launcher did nothing, also just typing

spyder

in a command line did not result in the GUI being fired up, it also did not result in an error message. However, typing

spyder --new-instance

resulted in the GUI being fired up. Looking into the file

start_app.py

in the directory

/usr/lib/python2.7/dist-packages/spyderlib/

it became clear the the following lines of code were the problem:

if CONF.get('main', 'single_instance') and not options.new_instance \
  and not mac_app:
    # Minimal delay (0.1-0.2 secs) to avoid that several
    # instances started at the same time step in their
    # own foots while trying to create the lock file
    time.sleep(random.randrange(1000, 2000, 90)/10000.)

    # Lock file creation
    lockf = get_conf_path('spyder.lock')
    lock = lockfile.FilesystemLock(lockf)

    # lock.lock() tries to lock spyder.lock. If it fails,
    # it returns False and so we try to start the client
    if not lock.lock():

        if args:
            send_args_to_spyder(args)
    else:
        atexit.register(lock.unlock)
        from spyderlib import spyder
        spyder.main()
else:
    from spyderlib import spyder
    spyder.main()

So, some instance of spyder was created previously and has created the file

spyder.lock

which resulted in the empty list of arguments given by the command

spyder

being passed to spyder, resulting in no action:

send_args_to_spyder(args)

Hence, renaming the spyder.lock file made spyder fire up again just using the app launcher or a terminal.

1

Solved the problem (kind of):

Did sudo gedit /home/USERNAME/.spyder2/.spyder.ini to look at the file, which basically contains your local spyder preferences/settings. If you know what the erroneous lines are supposed to say, you can simply change them.

Since i did not, I simply deleted my entire .spyder2 folder. It was then created anew when i did sudo apt-get purge spyder && sudo apt-get install spyder.

Simply doing sudo apt-get purge spyder or sudo apt-get install --reinstall spyder won't work since it doesn't affect your personal configuration file. You have to either repair or delete the .spyder.ini manually.

0

I had the same problem. When I tried to open Spyder from terminal, I got following error message:

ConfigParser.ParsingError: File contains parsing errors: /home/.spyder2/spyder.ini
    [line 55]: 'font/italic'

My solution:

  1. Open the spyder.ini file using nano /home/.spyder2/spyder.ini

  2. Then delete the [line 55]: 'font/italic'

  3. Save the file

Done! I could open Spyder.

0

This is a development on the fix proposed by Wilhelm Braun.

In my case, I did not get any error message. Simply and silently, Spyder 2.2.5 was not starting off, whether I used the command line or the desktop menu.

The command l ~/.spyder2 showed a dangling (red-coloured) symlink spyder.lock@.

Deleting this file made Spyder start as expected.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .