安装PyInstaller
pip install pyinstaller
使用PyInstaller
pyinstaller [options] script [script ...] | specfile
1
pyinstaller mypython.py
两个目录build和dist,dist下面的文件就是可以发布的可执行文件,对于上面的命令你会发现dist目录下面有一堆文件,各种都动态库文件和myscrip可执行文件。有时这样感觉比较麻烦,需要打包dist下面的所有东西才能发布
2
单文件模式
pyinstaller -F mypython.py