1.首先下载PyInstaller
官网地址入口
已经安装了pip,直接在命令行输入:
pip install pyinstaller
2.进行打包
进入需要被打包目录,输入:
pyinstaller -F yourprogram.py
//-F打包成一个.exe文件
另外,可以在官方的说明里看到 pyinstaller 目前并不支持python3.6,如下图:
所以,在打包python3.6的程序时,会出现“:IndexError: tuple index out of range”的错误。
要解决这个问题,需要到GitHub上下载 pyinstaller-develop