[python]python安裝包錯誤

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

在windows XP上windows

解決方法:this

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:\Python27\Lib\ 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:

 

參考連接:spa

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

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

相關文章
相關標籤/搜索