Issue
I use Spyder to run my python codes in my Mac OS x. It happens that spyder just crashed, and since them it doesn't open anymore. When I try to open it directly from ~/anaconda/bin, the following error msg appears: Image of the error
after I click in ok, I get back the lines of error:
[Julias-MBP-3:~/anaconda/bin] juliaroquette% ./spyder
2017-06-19 18:24:06.479 python[713:16813] modalSession has been exited prematurely - check for a reentrant call to endModalSession:
Traceback (most recent call last):
File "/Users/juliaroquette/anaconda/lib/python2.7/site-packages/spyder/app/mainwindow.py", line 3011, in main
mainwindow = run_spyder(app, options, args)
File "/Users/juliaroquette/anaconda/lib/python2.7/site-packages/spyder/app/mainwindow.py", line 2913, in run_spyder
main.setup()
File "/Users/juliaroquette/anaconda/lib/python2.7/site-packages/spyder/app/mainwindow.py", line 784, in setup
from spyder.plugins.help import Help
File "/Users/juliaroquette/anaconda/lib/python2.7/site-packages/spyder/plugins/help.py", line 33, in <module>
from spyder.utils.help.sphinxify import (CSS_PATH, generate_context,
File "/Users/juliaroquette/anaconda/lib/python2.7/site-packages/spyder/utils/help/sphinxify.py", line 29, in <module>
from docutils.utils import SystemMessage as SystemMessage
File "/Users/juliaroquette/anaconda/lib/python2.7/site-packages/docutils/utils/__init__.py", line 20, in <module>
import docutils.io
File "/Users/juliaroquette/anaconda/lib/python2.7/site-packages/docutils/io.py", line 18, in <module>
from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput
File "/Users/juliaroquette/anaconda/lib/python2.7/site-packages/docutils/utils/error_reporting.py", line 47, in <module>
locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]
File "/Users/juliaroquette/anaconda/lib/python2.7/locale.py", line 564, in getlocale
return _parse_localename(localename)
File "/Users/juliaroquette/anaconda/lib/python2.7/locale.py", line 477, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
I tried to do what the error msg suggest, and use the option --reset, but the same error still exist after that.
Anyone has any idea on how to solve this issue?
Solution
It is known that the MacPorts version of Spyder is raising this error:
ValueError: unknown locale: UTF-8
which doesn’t let it start correctly.
To fix it you will have to set these environment variables in your .profile (or .bashrc) manually:
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
Answered By - EarlGrey
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.