python 安装 ez_setup.py出现的问题及解决办法

安装ez_setup.py时出现了这个问题:

UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 1: ordinal not in range(128)
Something went wrong during the installation.
See the error message above.
 
解决办法:
打开C:\Python27\Lib下的 mimetypes.py 文件,在default_encoding = sys.getdefaultencoding()前面添加:
if sys.getdefaultencoding() != 'gbk':
reload(sys)
sys.setdefaultencoding('gbk')
 
注:解决方案转自https://code.csdn.net/snippets/147340
 
posted @ 2014-07-21 22:05  connorzx  阅读(919)  评论(0编辑  收藏  举报