美文网首页
python运行时报"Module 'sys' has no '

python运行时报"Module 'sys' has no '

作者: 对方正在脱发中 | 来源:发表于2020-07-06 16:41 被阅读0次

或者'ascii' codec can't decode byte 0xe8 in position 0: ordinal not in range(128)

这两个错误都是因为同时安装了python2 和python3环境 设置的编码方式冲突导致

解决方案:

如果你是python2 环境

在\Lib\site-packages 下新建sitecustomize.py

内容为“import sys

reload(sys)

sys.setdefaultencoding('utf-8')"

即可

相关文章

网友评论

      本文标题:python运行时报"Module 'sys' has no '

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