【问题标题】:How can I specifiy the .spec file in PyInstaller如何在 PyInstaller 中指定 .spec 文件
【发布时间】:2020-10-29 01:28:58
【问题描述】:

如何在使用 --onefile 使用 PyInstaller 编译我的 .py 文件时指定 .spec 文件 strong> 和 --noconsole 选项?

【问题讨论】:

    标签: python compilation pyinstaller


    【解决方案1】:

    试试这样的:

    C:\Python27\python.exe C:\Python27\Lib\site-packages\PyInstaller\main.py --onefile  --noconsole main.spec
    

    【讨论】:

      【解决方案2】:

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

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

        pyinstaller main.py

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

      • 使用.spec 文件:

        pyinstaller main.spec

      【讨论】:

        猜你喜欢
        • 2016-09-16
        • 2012-04-14
        • 2016-12-14
        • 2018-08-11
        • 2021-09-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多