1

During a Spyder session my Linux froze. After startup, I could not start Spyder; I got the following error instead:

(trusty)dreamer@localhost:~$ spyder
Traceback (most recent call last):
  File "/home/dreamer/anaconda2/bin/spyder", line 2, in <module>
    from spyderlib import start_app
  File "/home/dreamer/anaconda2/lib/python2.7/site-packages/spyderlib/start_app.py", line 13, in <module>
    from spyderlib.config import CONF
  File "/home/dreamer/anaconda2/lib/python2.7/site-packages/spyderlib/config.py", line 736, in <module>
    subfolder=SUBFOLDER, backup=True, raw_mode=True)
  File "/home/dreamer/anaconda2/lib/python2.7/site-packages/spyderlib/userconfig.py", line 215, in __init__
    self.load_from_ini()
  File "/home/dreamer/anaconda2/lib/python2.7/site-packages/spyderlib/userconfig.py", line 260, in load_from_ini
    self.readfp(configfile)
  File "/home/dreamer/anaconda2/lib/python2.7/ConfigParser.py", line 324, in readfp
    self._read(fp, filename)
  File "/home/dreamer/anaconda2/lib/python2.7/ConfigParser.py", line 479, in _read
    line = fp.readline()
  File "/home/dreamer/anaconda2/lib/python2.7/codecs.py", line 690, in readline
    return self.reader.readline(size)
  File "/home/dreamer/anaconda2/lib/python2.7/codecs.py", line 545, in readline
    data = self.read(readsize, firstline=True)
  File "/home/dreamer/anaconda2/lib/python2.7/codecs.py", line 492, in read
    newchars, decodedbytes = self.decode(data, self.errors)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xfe in position 2: invalid start byte
(trusty)dreamer@localhost:~$ 

I have found this solution, which sounds very much like my problem, but am curious if there are others, and whether anyone knows why this occurred.

Community
  • 1
  • 1

1 Answers1

0

My guess is that your spyder configuration file somehow got corrupted. This is the file spyder.ini, which resides in a directory like ~/.spyder2 (the exact name of the directory depends on the version you have installed). Maybe the encoding of the configuration file changed or a Unicode byte order mark was somehow introduced.

Possible solutions: use an editor to convert the file back to UTF-8; delete the configuration file; delete the whole directory containing the configuration file. The last two obviously delete any changes you made to the configuration.

Jitse Niesen
  • 4,492
  • 26
  • 23