【问题标题】:How do I add an author using cx_Freeze?如何使用 cx_Freeze 添加作者?
【发布时间】:2023-01-04 15:12:45
【问题描述】:

我尝试:

from cx_Freeze import setup, Executable
build_exe_options = {"packages": ["torch", 'tensorflow']}


target = Executable(
    script='start.py',
)
setup(
    name='my',
    options={'build_exe': build_exe_options},
    author="me",
    executables=[target]
)

但是当我检查start.exe 的文件属性中的版权字段时,它是空的。

【问题讨论】:

    标签: python exe cx-freeze


    【解决方案1】:

    您需要添加一个version 字段:

    setup(
        ...
        version='0.1',
        ...
    )
    

    否则不会创建可执行文件属性,如警告所示:

    警告:无法创建版本资源:必须指定版本

    该版本需要与PEP440兼容,请参阅setuptools文档中的Specifying Your Project’s Version。

    【讨论】:

      猜你喜欢
      • 2014-09-11
      • 2012-04-11
      • 2012-05-23
      • 2020-06-21
      • 2012-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-03
      相关资源
      最近更新 更多