用‘pyinstaller'给Python打包生成exe文件,显示TypeError,这是怎么原因?

用‘pyinstaller'给Python打包生成exe文件,显示TypeError,这是怎么原因?

问题描述:

试过用很多的方法都不行,除了换python版本这个方法没试过,其他的网上的方法都基本试过,以为是代码问题,结果print('hello world')都不行。

TypeError: an integer is required (got type bytes) 

安装版本低了

去安装最新的

重装这个版本的pyinstaller:

pip install https://github.com/pyinstaller/pyinstaller/tarball/develop

重装一下试试看

pip uninstall pyinstaller
pip install pyinstaller

我安装了3.9的python版本,重新安装3.6版本的就可以了