python显示语言错误_python语言环境奇怪错误。到底怎么回事?

所以今天我升级到了bazaar 2.0.2,我开始收到这条消息(顺便说一句,我在玩雪豹游戏):bzr: warning: unknown locale: UTF-8

Could not determine what text encoding to use.

This error usually means your Python interpreter

doesn't support the locale set by $LANG (en_US.UTF-8)

Continuing with ascii encoding.

很奇怪,因为我的郎酒实际上是空的。当我尝试修改locale模块时,也会发生类似的事情Python 2.5.4 (r254:67916, Nov 30 2009, 14:09:22)

[GCC 4.3.4] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import locale

>>> locale.getdefaultlocale()

Traceback (most recent call last):

File "", line 1, in

File "/Users/sbo/runtimes/lib/python2.5/locale.py", line 443, in getdefaultlocale

return _parse_localename(localename)

File "/Users/sbo/runtimes/lib/python2.5/locale.py", line 375, in _parse_localename

raise ValueError, 'unknown locale: %s' % localename

ValueError: unknown locale: UTF-8

输出语言没有帮助sbo@dhcp-045:~ $ export LANG=en_US.UTF-8

sbo@dhcp-045:~ $ bzr

bzr: warning: unknown locale: UTF-8

Could not determine what text encoding to use.

This error usually means your Python interpreter

doesn't support the locale set by $LANG (en_US.UTF-8)

Continuing with ascii encoding.

然而,这解决了问题sbo@dhcp-045:~ $ export LANG=en_US.UTF-8

sbo@dhcp-045:~ $ export LC_ALL=en_US.UTF-8

Python 2.5.4 (r254:67916, Nov 30 2009, 14:09:22)

[GCC 4.3.4] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import locale

>>> locale.getdefaultlocale()

('en_US', 'UTF8')

你能解释一下这是怎么回事吗,为了更好地粘在一起?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值