1、pyinstaller的说明:
pyinstaller 能够在 Windows、Linux、Mac 等操作系统下将 Python 源文件打包,通过对源文件打包, Python 程序可以在没有安装 Python 的环境中运行,也可以作为一个独立文件方便传递和管理。
PyInstaller 支持 Python 2.7 和 Python 3.3+。可以在 Windows、Mac 和 Linux 上使用,但是并不是跨平台的,而是说要是希望打包成 .exe 文件,需要在Windows 系统上运行 PyInstaller 进行打包工作;打包成 Mac App,需要在 Mac OS 上使用,Linux 也一样,不能在一端上打另外两端的包,还有 Mac m1 的打包不能给 Mac intel 的使用,相反也一样,运行会报错:Error:Bad CPU type in executable。
pyinstaller 不需要自己写 setup.py 文件,只需要在工作目录中输入打包命令即可。最后会生成 build 和 dist 文件夹,启动文件在 dist 文件夹下。
2、pyinstaller的安装
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyinstaller