安装Python报错

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
BUILD FAILED (Ubuntu 16.04 using python-build 20160602)

Inspect or clean up the working tree at /tmp/python-build.20180326120047.16929
Results logged to /tmp/python-build.20180326120047.16929.log

Last 10 log lines:
File "/tmp/python-build.20180326120047.16929/Python-3.5.2/Lib/ensurepip/__init__.py", line 116, in bootstrap
_run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/tmp/python-build.20180326120047.16929/Python-3.5.2/Lib/ensurepip/__init__.py", line 41, in _run_pip
pip.main(args)
File "/tmp/tmpn7rno8qm/pip-8.1.1-py2.py3-none-any.whl/pip/__init__.py", line 215, in main
File "/tmp/python-build.20180326120047.16929/Python-3.5.2/Lib/locale.py", line 594, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
Makefile:1060: recipe for target 'install' failed
make: *** [install] Error 1

解决办法:

  1. sudo apt-get install language-pack-id
  2. sudo dpkg-reconfigure locales
  3. 选中zh_CN.UTF-8
  4. 重新安装