以下是我遇到的问题:
我在使用pip install fabric时报错:
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/pynacl
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point(‘pip==1.5.4‘, ‘console_scripts‘, ‘pip‘)()
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 235, in main
return command.main(cmd_args)
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
text = ‘\n‘.join(complete_log)
UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte 0xe6 in position 49: ordinal not in range(128)
原因:
[email protected]:~# echo $LANG
zh_CN.UTF-8
可以看出我的系统是中文的。
解决:
cd /usr/lib/python2.7/dist-packages/urllib3/packages
vim sitecustomize.py
import sys
sys.setdefaultencoding(‘utf-8‘)
chmod a+x sitecustomize.py
重新安装就好了