根本原因是:您的环境变量
LC_ALL丢失或无效
简短答案-
只需运行以下命令:
$ export LC_ALL=C
如果在新的终端窗口中仍然出现错误,请在
.bashrc文件底部添加错误。
长答案-
这是我的
locale设置:
$ localeLANG=en_US.UTF-8LANGUAGE=LC_CTYPE="C"LC_NUMERIC="C"LC_TIME="C"LC_COLLATE="C"LC_MonETARY="C"LC_MESSAGES="C"LC_PAPER="C"LC_NAME="C"LC_ADDRESS="C"LC_TELEPHONE="C"LC_MEASUREMENT="C"LC_IDENTIFICATION="C"LC_ALL=C
Python2.7
$ uname -a Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u6 (2015-11-09) x86_64 GNU/Linux $ python --version Python 2.7.9 $ pip --version pip 8.1.1 from /usr/local/lib/python2.7/dist-packages (python 2.7) $ unset LC_ALL $ pip install virtualenv Traceback (most recent call last): File "/usr/local/bin/pip", line 11, in <module> sys.exit(main()) File "/usr/local/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 579, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting $ export LC_ALL=C $ pip install virtualenv Requirement already satisfied (use --upgrade to upgrade): virtualenv in /usr/local/lib/python2.7/dist-packages
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)