admin管理员组文章数量:1611176
若尝试以下无效
函数('地址',encoding='UTF-8')
重启spyder可能有效
根本解决方法是:
修改文件C or D:\****\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py,spyder重启后生效。
def get_file_code(filename):
"""Retrive the content of a file."""
# Get code from spyder
try:
file_code = frontend_request().get_file_code(filename)
except (CommError, TimeoutError):
file_code = None
if file_code is None:
with open(filename, 'r',encoding='utf-8') as f:#增加 ,encoding='utf-8'
return f.read()
return file_code
参考资料:
https://blog.csdn/zhangpeterx/article/details/103843773
https://www.py/tools/anaconda/16427.html
版权声明:本文标题:提示"UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 44: illegal multibyte sequenc 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1728607737a1165664.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论