下載並安裝pyinstaller-4.3
下載後解壓,在對應的目錄下執行install
pip3 install PyInstaller
在線安裝
pip install -U https://github.com/pyinstaller/pyinstaller
单文件打包
pyinstaller -F main.py
生成spec文件
pyi-makespec -w main.py
通过spec文件打包
pyinstaller main.spec
升級pip
You should consider upgrading via the 'd:\python\python.exe -m pip install --upgrade pip' command.
python.exe -m pip install --upgrade pip
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.3.3
Uninstalling pip-20.3.3:
Successfully uninstalled pip-20.3.3
Successfully installed pip-21.1.3
–noconsole
–noconsole' not found
去掉–noconsole
-F $FileNameWithoutExtension$.py –noconsole
-F $FileNameWithoutExtension$.py