1. 程式人生 > >Python locale error: unsupported locale setting

Python locale error: unsupported locale setting

ng- turn fig 設置 usr clas python traceback all

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 "/usr/lib/python2.7/locale.py", line 581, in setlocale
return _setlocale(category, locale)

這是地區編碼設置問題

2、解決辦法

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

最後一步按兩次OK就可以了。

Python locale error: unsupported locale setting