python语言环境在我的机器上不起作用(osx 10.7.4) [英] python locale not working on my machine (osx 10.7.4)

查看:60
本文介绍了python语言环境在我的机器上不起作用(osx 10.7.4)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用python语言环境时出现此错误

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

我这里有所有必要的文件. http://i.imgur.com/FRRyv.png

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

问题出在哪里?

推荐答案

您缺少python安装的_locale C扩展名,并且该扩展名仅支持C语言环境.

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

这篇关于python语言环境在我的机器上不起作用(osx 10.7.4)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆