本文链接地址: 【已解决】pyinstaller UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xce in position 110: invalid continuation byte

pyinstaller打包的时候,报错如下:
File "D:\Python34\lib\site-packages\PyInstaller\hooks\hook-zmq.py", line 18, in <module>
hiddenimports.extend(collect_submodules('zmq.backend'))
File "D:\Python34\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 619, in collect_submodules
repr(pkg_dir), package))
File "D:\Python34\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 90, in exec_statement
return __exec_python_cmd(cmd)
File "D:\Python34\lib\site-packages\PyInstaller\utils\hooks\__init__.py", line 77, in __exec_python_cmd
txt = exec_python(*cmd, env=pp_env)
File "D:\Python34\lib\site-packages\PyInstaller\compat.py", line 549, in exec_python
return exec_command(*cmdargs, **kwargs)
File "D:\Python34\lib\site-packages\PyInstaller\compat.py", line 356, in exec_command
out = out.decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xce in position 110: invalid continuation byte
这个错误,后来通过Google之后,解决方案如下:
其实就是:
修改D:\Python34\Lib\site-packages\PyInstaller\compat.py文件中
out = out.decode(encoding)
为:
out = out.decode(encoding, errors='ignore')
然后再次运行脚本就不会报错了。
本文链接地址: 【已解决】pyinstaller UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xce in position 110: invalid continuation byte
文章的脚注信息由WordPress的wp-posturl插件自动生成
微信扫一扫,打赏作者吧~
![[整理]how to run flask with pyqt5](http://www.jyguagua.com/wp-content/themes/begin/timthumb.php?src=http://www.jyguagua.com/wp-content/uploads/2021/03/pyqt_flask.png&w=280&h=210&zc=1)
![[已解决]LINK : fatal error LNK1158: cannot run 'rc.exe' 错误的解决办法](http://www.jyguagua.com/wp-content/themes/begin/timthumb.php?src=http://www.jyguagua.com/wp-content/uploads/2021/02/Snipaste_2021-02-17_15-18-26-1024x505.png&w=280&h=210&zc=1)
![[已解决]Python扩展模块 error: Unable to find vcvarsall.bat](http://www.jyguagua.com/wp-content/themes/begin/timthumb.php?src=http://www.jyguagua.com/wp-content/uploads/2020/11/Snipaste_2020-11-19_10-01-38.png&w=280&h=210&zc=1)
2020年08月04日 下午 2:56 沙发
另一种解决方案是在py文件声明编码类型,加上:# coding:gbk,重新打包