用pyinstaller打包py文件为exe文件时产生错误UnicodeDecodeError: 'gbk' codec can't decode byte 0x88 in position 166:
首先找到这个文件,用文本编辑器打开
把1074到1078行改为
if not need_new:
with open(filename, encoding='gb18030',errors='ignore') as f:
old_xml = f.read()
new_xml = manifest.toprettyxml().replace('\r','')
连gb18030都不能编码的字符,错误可以直接忽略掉了,这样便不会报错
生成的exe文件正常运行