[问题解决]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

原文地址:https://www.cnblogs.com/everfight/p/locale_error.html

时间: 2024-11-05 18:58:10

[问题解决]Python locale error: unsupported locale setting的相关文章

Python locale error: unsupported locale setting

1. 问题 用pip install安装包的时候会提示: Traceback (most recent call last): File "/usr/bin/pip", line 11, in sys.exit(main()) File "/usr/lib/python2.7/dist-packages/pip/init.py", line 215, in main locale.setlocale(locale.LC_ALL, '') File "/us

pip install 时locale.Error: unsupported locale setting

查看配置 locale 更改配置 export LC_ALL=C 下图为结果

使用GBK编码请求访问nodejs程序报415错误:Error: unsupported charset at urlencodedParser ...

最近遇到一个问题,第三方用户向我们提供给的回调地址发送请求时一直报415错误,结果发现他们使用的是GBK编码请求,而我们使用的node + express4 程序,不支持GBK编码请求. 问题出在下面一段代码. app.use(bodyParser.json()); app.use(bodyParser.urlencoded({extended: false})); //这一行 查看body-parser源码,发现引起问题的一段代码如下 var charset = typer.parse(req

Error: Unsupported java version &#39;1.8&#39; in line 2 of file &#39;proguard.conf&#39;

执行Maven Install打包的时候,出现以下错误信息: [proguard] Error: Unsupported java version '1.8' in line 2 of file 'F:\Workspaces\pro-test\proguard.conf', [proguard] included from argument number 6 这是因为在proguard.conf文件中显示的指定的Java的版本,但是net\sf\proguard\proguard\4.4\pro

python socket.error: [Errno 10054] 解决方法

我用的是python2.7   我搜网上10054错误解决方法的时候发现,大部分文章都是以python3为基础的,对于python2不适用. python socket.error: [Errno 10054]  远程主机强迫关闭了一个现有的连接. 原因:服务器发现你的爬虫行为了,所有强制断开链接了 解决办法:  服务器知道你是爬虫,加headers, 模拟浏览器agent:head中有一个user-agent每次都换不同的模拟代理 #coding:utf-8 import urllib2 ur

error: unsupported reloc 43

在Ubuntu 16.04.5 LTS编译android 5.1报错 [19:17:13.062]libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43 [19:17:13.062]libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43 [19:17:13.062]libnativehelper/JniInvocation.cpp:165:

### The error occurred while setting parameters, MyBatis框架使用报错原因及解决办法

### Error querying database. Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete,create_time,update_timeFROM tb_user WH

pip: unsupported locale setting

在终端里输入 $ export LC_ALL=C 可解决 http://stackoverflow.com/questions/36394101/pip-install-locale-error-unsupported-locale-setting

Python Issue: ValueError unknown locale: UTF-8 on OS X (Spyder)

In your bash_profile you lack of something. add export LANG="en_US.UTF-8" export LC_COLLATE="en_US.UTF-8" export LC_CTYPE="en_US.UTF-8" export LC_MESSAGES="en_US.UTF-8" export LC_MONETARY="en_US.UTF-8" exp