如何在 PyInstaller 中指定 .spec 文件

Arm*_*res 8 python compilation pyinstaller

在使用PyInstaller使用--onefile--noconsole选项编译.py文件时,如何指定.spec文件?

Gle*_*son 8

PyInstaller将生成一个.spec文件。您可以首先针对您的单文件应用程序运行它,然后在将来的运行中参考您编辑的.spec文件

  • 使用一个文件应用程序:

    pyinstaller main.py

    注意:这将覆盖,main.spec所以不要在以后的运行中使用它

  • 使用.spec文件:

    pyinstaller main.spec


Nor*_*Cat 7

尝试这样的事情:

C:\Python27\python.exe C:\Python27\Lib\site-packages\PyInstaller\main.py --onefile  --noconsole main.spec
Run Code Online (Sandbox Code Playgroud)