不導入當我嘗試import brian2
在蟒蛇的蟒蛇分佈我收到此錯誤信息:brian2在水蟒蟒分佈
>> import brian2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named brian
>>> import brian2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "//anaconda/lib/python2.7/site-packages/brian2/__init__.py", line 37, in <module>
from pylab import *
File "//anaconda/lib/python2.7/site-packages/pylab.py", line 1, in <module>
from matplotlib.pylab import *
File "//anaconda/lib/python2.7/site-packages/matplotlib/__init__.py", line 1131, in <module>
rcParams = rc_params()
File "//anaconda/lib/python2.7/site-packages/matplotlib/__init__.py", line 975, in rc_params
return rc_params_from_file(fname, fail_on_error)
File "//anaconda/lib/python2.7/site-packages/matplotlib/__init__.py", line 1100, in rc_params_from_file
config_from_file = _rc_params_in_file(fname, fail_on_error)
File "//anaconda/lib/python2.7/site-packages/matplotlib/__init__.py", line 1018, in _rc_params_in_file
with _open_file_or_url(fname) as fd:
File "//anaconda/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "//anaconda/lib/python2.7/site-packages/matplotlib/__init__.py", line 1000, in _open_file_or_url
encoding = locale.getdefaultlocale()[1]
File "//anaconda/lib/python2.7/locale.py", line 543, in getdefaultlocale
return _parse_localename(localename)
File "//anaconda/lib/python2.7/locale.py", line 475, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
我不明白爲什麼?這是否與matplotlib
和pylab
有關?
LANG或LANGUAGE環境變量設置爲無效的「UTF-8」。嘗試在您的shell中輸出LANG = en_US.UTF-8'並再次運行Python。如果你告訴我你住在哪個國家以及你的母語是什麼,那麼LANG可能會有一個更合適的定義。 – msw
安裝brian2時是否遵循了這些說明? http://brian2.readthedocs.org/en/2.0b4/introduction/install.html –
anaconda版本不起作用,因此我使用'brian2'的普通'pip'安裝。 現在它使用Apple提供的python和平進口。 –