本文主要介绍安装pyinstaller教程与pyinstaller打包出现 TypeError: an integer is required (got type bytes)异常问题解决办法:
1.安装PyInstaller
执行:
如果遇到warning提示:
就按照提示执行即可:
执行完上述指令后,再输入pip install PyInstaller确认下
安装完毕~~
2. 常用的PyInstaller打包命令参数如下:
–i 图标路径;
-F 打包成一个exe文件;
-w 无控制台窗口;
-c 使用控制台;
-D 创建一个目录,里面包含exe以及其他一些依赖性文件;
一般看帮助即可,-h
3.打包py文件
首先写一个demo:test.py
执行打包指令:
执行成功后会生成build、dist文件夹如下所示:
其中exe程序就在dist中,验证一下:
大功告成!
4.针对有些童鞋执行打包结果出现异常问题:TypeError: an integer is required (got type bytes)
解决方案:请输入如下命令:
就完美解决TypeError: an integer is required (got type bytes)异常,使用PyInstaller打包完成。
5.友情提示:
如果电脑中同时存在多个版本的python可能会导致各种异常问题,建议只保留一个版本的python使用,最好安装前,先完全删除老的,然后再安装新的,防止不必要麻烦。
6.引经据典:
http://www.pyinstaller.org/downloads.html
https://pyinstaller.readthedocs.io/en/stable/usage.html#general-options