本文主要是介绍UnicodeDecodeError ascii codec can't decode byte 0xe5 in position 0 ordinal not in range(128),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
运行python程序时出现以下错误:
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe5 in position 0: ordinal not in range(128)
解决办法:
摘自:https://stackoverflow.com/questions/21393758/unicodedecodeerror-ascii-codec-cant-decode-byte-0xe5-in-position-0-ordinal
Figured it out.
I put the following at the start of my python file
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
这篇关于UnicodeDecodeError ascii codec can't decode byte 0xe5 in position 0 ordinal not in range(128)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!