解決unicodedecodeerror ascii codec can’t decode byte 0xd7 in position 9 ordinal not in range(128)

Windows平臺下,安裝python模塊時,報以下錯誤:python

UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 9: ordinal not in range(128)windows

python

解決方法:code

修改mimetypes.py文件,路徑位於python的安裝路徑下的Lib\mimetypes.py文件。在import下添加以下幾行:blog

 

if sys.getdefaultencoding() != 'utf-8': 
 reload(sys) 
 sys.setdefaultencoding('utf-8')
相關文章
相關標籤/搜索