python:使用PyInstaller打包成exe文件,以及TypeError: an integer is required (got type bytes)异常解决

左心房为你撑大大i 提交于 2020-04-24 22:57:12

用python3.6以上使用pyinstaller打包会出现 TypeError: an integer is required (got type bytes)异常, 解决办法如下:

1. 安装pyinstaller

pip install PyInstaller

 

 

 

2. 打包单个文件

PyInstaller -F xxx.py

 

 

3. 出现异常 TypeError: an integer is requried(got type bytes)

原因:pyinstaller版本问题

解决方案:命令行输入如下命令卸载之前版本pyinstaller,更新为最新版本

Tips: 出现异常请更新pip:python -m pip install --upgrade pip

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.tar.gz

 

 

4.再次执行打包命令:

pyinstaller -F 123.py

 

打包成功! 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!