Python easy_install安装插件错误(UnicodeDecodeError)解决办法

  电脑上安装的Python是2.7.10,在使用easy_install安装pandas库时发生错误:unicodedecodeerror: 'ascii' codec can't decode byte 0xb8 in position 7: ordinal not in range(128)

  经过许久的折腾以及资料查找,找到了一个解决办法

  在安装目录下找到 .\Lib\mimetypes.py 该文件,然后在import下添加以下几行代码

1 # add myself
2 if sys.getdefaultencoding() != 'gbk':
3     reload(sys)
4     sys.setdefaultencoding('gbk')

  

PS:新手自学,随笔记录,如果有更好的方法,欢迎指点!

posted @ 2015-11-01 11:19  leng_  阅读(261)  评论(0)    收藏  举报