Solution for UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 1: ordinal not in

ZZ: https://bitbucket.org/pypa/setuptools/issue/127/unicodedecodeerror-when-install-in-windowspython

HELLO! I come here by Google. I notice that the asker is a Chinese, the same to me. So, maybe we face the same problem. Then I register this website. Oh, sorry for my bad English!web

I HAVE FIND THE RIGHT ANSWER!windows

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.this

It can be solved like this:spa

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:code

1 if sys.getdefaultencoding() != 'gbk': 
2     reload(sys)
3     sys.setdefaultencoding('gbk')
4 default_encoding = sys.getdefaultencoding()

 

簡單來講,就是有些國內軟件修改註冊表致使python沒法安裝庫,要改下lib目錄下的代碼。blog

相關文章
相關標籤/搜索