【发布时间】:2020-10-29 01:28:58
【问题描述】:
如何在使用 --onefile 使用 PyInstaller 编译我的 .py 文件时指定 .spec 文件 strong> 和 --noconsole 选项?
【问题讨论】:
标签: python compilation pyinstaller
如何在使用 --onefile 使用 PyInstaller 编译我的 .py 文件时指定 .spec 文件 strong> 和 --noconsole 选项?
【问题讨论】:
标签: python compilation pyinstaller
试试这样的:
C:\Python27\python.exe C:\Python27\Lib\site-packages\PyInstaller\main.py --onefile --noconsole main.spec
【讨论】:
PyInstaller 将生成一个.spec 文件。您可以首先针对您的一个文件应用程序运行它,然后为将来的运行参考您编辑的 .spec 文件
使用一个文件应用程序:
pyinstaller main.py
注意:这将覆盖main.spec,所以不要在以后的运行中使用它
使用.spec 文件:
pyinstaller main.spec
【讨论】: