python locale not working on my machine (osx 10.7.

2019-04-13 01:36发布

Im getting this error when i try to use 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

I have all necessary files here. http://i.imgur.com/FRRyv.png

Where is the problem ?

1条回答
孤傲高冷的网名
2楼-- · 2019-04-13 02:16

You are missing the _locale C extension for your python installation, and it'll only support the C locale without that.

查看更多
登录 后发表回答