windows7(64位)python安装ez_setup报编码错误

UnicodeDecodeError:‘ascii’ code can't decode byte 0xcc in position 2:ordinal not in range(128)
网上搜了很多答案,试了一些,还是不行,只是一些类似的错误,而且大多是window8下的。坐等大牛来解决。

    Python报错UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe0 in position 0: ordinal not in range(128)

    这是Python 2 mimetypes的bug

    需要将Python2.7\lib\mimetypes.py文件中如下片段注释或删除:

try:
    ctype = ctype.encode(default_encoding) # omit in 3.x!
except UnicodeEncodeError:
    pass

 若还有问题,可以私信我。

追问

追答

打开Python2.7\lib\mimetypes.py,搜索下面的片段,注释或删掉就可以了。

try:
    ctype = ctype.encode(default_encoding) # omit in 3.x!
except UnicodeEncodeError:
    pass


温馨提示:答案为网友推荐,仅供参考
相似回答