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


用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

 

打包成功! 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM