美文网首页
win10 python编码问题

win10 python编码问题

作者: Super_me14 | 来源:发表于2017-09-27 14:07 被阅读14次

1.Python在windows7/8下安装Setuptools,执行ez_setup.py进行安装时会发生错误,提示编码问题导致异常
解决办法:编辑Python安装目录下的mimetypes.py文件,在文件中对应位置增加【3-6行】的部分内容

import os
import sys
#the following two line solve the "python ez_setup.py" install error
reload(sys)
sys.setdefaultencoding('gb18030')
#end
import posixpath
import urllib

相关文章

网友评论

      本文标题:win10 python编码问题

      本文链接:https://www.haomeiwen.com/subject/qkduextx.html