[python]python安装包错误

 “UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xb0 in position 1: ordinal not in range(128)” 

在windows XP上

解决方法:

Solution:
======================

It is because when Python install some packages, it will check the Windows Registry, some Chinese software like Aliwangwang import ‘gbk’ value to the HKEY_CLASSES_ROOT. So Python doesn’t work.

It can be solved like this:

open C:Python27Lib mimetypes.py with Notepad ++ or other editor, then search the line ” default_encoding = sys.getdefaultencoding()”. add codes to the line above like this:

if sys.getdefaultencoding() != 'gbk':
    reload(sys)
    sys.setdefaultencoding('gbk')
    default_encoding = sys.getdefaultencoding()
From:

参考链接:

http://stackoverflow.com/questions/17931726/ascii-codec-cant-decode-error-when-use-pip-to-install-uwsgi/20986067#20986067

http://blog.libofeng.cn/?p=37

原文地址:https://www.cnblogs.com/silenceli/p/4140050.html