用python3.6.6打包程序时遇到了如下错误

python 3.6 下 PyInstaller 打包exe出错 UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position

可以看到是old_xml = read.() 那里出了错,所以到winmanifest.py找到1076行,可以看到

python 3.6 下 PyInstaller 打包exe出错 UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position

将 with open(filename) as f : 变为 with open(filename,encoding="UTF-8") as f : 

如图:

python 3.6 下 PyInstaller 打包exe出错 UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position

再次打包exe

python 3.6 下 PyInstaller 打包exe出错 UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position

我们发现打包成功,UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position 198: illegal multibyte sequence 解决了

相关文章:

  • 2021-04-02
  • 2021-10-29
  • 2022-12-23
  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
  • 2021-11-18
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案