UnicodeDecodeError: 'ascii' codec can't decode byte 0xc0 in position 7: ordinal not in range(128)

解决方法1:

在这个目录UnicodeDecodeError: 'ascii' codec can't decode byte 0xc0 in position 7: ordinal not in range(128)下新建sitecustomize.py

写入:

import sys   

sys.setdefaultencoding('gb2312')

保存即可

解决方法2:

 

修改python安装目录 Python27\Lib\目录下的mimetypes.py文件。

在import下添加如下几行:

if sys.getdefaultencoding() != 'gbk':   
  reload(sys)   

 sys.setdefaultencoding('gbk') 

保存即可

相关文章:

  • 2022-12-23
  • 2021-07-24
  • 2022-12-23
  • 2021-06-01
猜你喜欢
  • 2021-09-25
  • 2022-01-05
  • 2021-07-24
  • 2021-05-10
  • 2021-08-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案