我尝试使用python locale
时出现此错误>>> locale.setlocale(locale.LC_ALL, 'de_DE')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 539, in setlocale
return _setlocale(category, locale)
File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 80, in setlocale
raise Error, '_locale emulation only supports "C" locale'
ValueError: _locale emulation only supports "C" locale
我这里有所有必要的文件。 http://i.imgur.com/FRRyv.png
问题出在哪里?
答案 0 :(得分:1)
你缺少python安装的_locale
C扩展,并且它只支持C
语言环境而没有它。