Python: Spyder 崩溃了,打不开了
Python: Spyder crashed and doesn't open anymore
我使用 Spyder 在 Mac OS x 中 运行 我的 python 代码。
碰巧 spyder 刚刚崩溃了,因为它们不再打开了。
当我尝试直接从 ~/anaconda/bin 打开它时,出现以下错误消息:
Image of the 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
我尝试按照错误消息的建议进行操作,并使用选项 --reset,但之后仍然存在相同的错误。
有人知道如何解决这个问题吗?
已知 Spyder 的 MacPorts 版本引发此错误:
ValueError:未知语言环境:UTF-8
无法正常启动。
要修复它,您必须在 .profile(或 .bashrc)中手动设置这些环境变量:
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
我使用 Spyder 在 Mac OS x 中 运行 我的 python 代码。 碰巧 spyder 刚刚崩溃了,因为它们不再打开了。 当我尝试直接从 ~/anaconda/bin 打开它时,出现以下错误消息: Image of the 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
我尝试按照错误消息的建议进行操作,并使用选项 --reset,但之后仍然存在相同的错误。
有人知道如何解决这个问题吗?
已知 Spyder 的 MacPorts 版本引发此错误:
ValueError:未知语言环境:UTF-8
无法正常启动。
要修复它,您必须在 .profile(或 .bashrc)中手动设置这些环境变量:
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8