pip安装python包出错:ctype = ctype.encode(default_encoding) # omit in 3.x!

python27中 Lib\mimetypes.py的一个bug,属于 "def enum_types(mimedb)"函数:

File "D:\Python27\lib\mimetypes.py", line 249, in enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 1: ordinal not in range(128)

解决方法:
删除
try: ctype = ctype.encode(default_encoding) # omit in 3.x! except UnicodeEncodeError: pass
这几行即可

原文地址: http://www.360doc.com/content/14/0225/21/3970407_355676659.shtml

你可能感兴趣的:(python,bug)