python语言环境_Python语言环境错误:不支持的语言环境设置
发布日期:2021-10-31 07:31:57 浏览次数:2 分类:技术文章

本文共 824 字,大约阅读时间需要 2 分钟。

在python中执行此操作时为什么会出现以下错误:

>>> import locale

>>> print str( locale.getlocale() )

(None, None)

>>> locale.setlocale(locale.LC_ALL, 'de_DE')

Traceback (most recent call last):

File "", line 1, in

File "/usr/lib/python2.7/locale.py", line 531, in setlocale

return _setlocale(category, locale)

locale.Error: unsupported locale setting

这也适用于其他语言环境,例如fr或nl。我正在使用Ubuntu 11.04。

更新:执行以下操作不会产生任何结果:

dpkg-reconfigure locales

perl: warning: Setting locale failed.

perl: warning: Please check that your locale settings:

LANGUAGE = (unset),

LC_ALL = (unset),

LC_CTYPE = "UTF-8",

LANG = (unset)

are supported and installed on your system.

perl: warning: Falling back to the standard locale ("C").

locale: Cannot set LC_CTYPE to default locale: No such file or directory

locale: Cannot set LC_ALL to default locale: No such file or directory

转载地址:https://blog.csdn.net/weixin_39934257/article/details/110545993 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:502 proxy error解决方法_Vue项目中经常碰到的痛点和解决方法(上)
下一篇:python移动文件_python 剪切移动文件

发表评论

最新留言

逛到本站,mark一下
[***.202.152.39]2024年03月28日 04时42分15秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章