python语言环境不能在我的机器上运行(osx 10.7.4)

时间:2012-08-25 17:13:45

标签: python macos locale

我尝试使用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

问题出在哪里?

1 个答案:

答案 0 :(得分:1)

你缺少python安装的_locale C扩展,并且它只支持C语言环境而没有它。