我有一个小小的服务器,我正在设置Ubuntu 14.04。之后,我想设置一些东西,但我遇到了这个问题:
File "/usr/lib/python3.5/runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/lib/python3.5/dist-packages/pip/__main__.py", line 19, in <module>
sys.exit(pip.main())
File "/usr/local/lib/python3.5/dist-packages/pip/__init__.py", line 215, in main
locale.setlocale(locale.LC_ALL, '')
File "/usr/lib/python3.5/locale.py", line 595, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
You may need to use sudo to install dependencies.
有人可以帮忙吗?
编辑:
从运行的语言环境来看,这就是我所拥有的:
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
这是从一个点子安装。
答案 0 :(得分:1)
好的,所以看起来系统区域设置存在问题。
在控制台中一个接一个地运行:
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
export LANGUAGE="en_US"
pip install package_name_that_caused_an_error
如果这一切都以这种方式运行,那么在同一个控制台中运行(以保留您导出的设置):
sudo dpkg-reconfigure locales
重新启动计算机,看看是否会出现同样的错误。如果一切正常,你不应该得到它们。