[问题解决]Python locale error: unsupported locale setting

Posted everfight的成长之路

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[问题解决]Python locale error: unsupported locale setting相关的知识,希望对你有一定的参考价值。

原文来源:https://stackoverflow.com/questions/14547631/python-locale-error-unsupported-locale-setting

安装flask包的时候,不支持语言环境,报错如下:

Traceback (most recent call last):
  File "/usr/bin/pip3", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python3/dist-packages/pip/__init__.py", line 215, in main
    locale.setlocale(locale.LC_ALL, '')
  File "/usr/lib/python3.5/locale.py", line 594, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

解决方法:
依次执行一下命令:

export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo dpkg-reconfigure locales 选择en_US.UTF-8

以上是关于[问题解决]Python locale error: unsupported locale setting的主要内容,如果未能解决你的问题,请参考以下文章