【问题标题】:cx_freeze yields "NameError: name 'build_exe_options' is not defined" on build attemptcx_freeze 在构建尝试时产生“NameError: name 'build_exe_options' is not defined”
【发布时间】:2013-06-13 17:29:24
【问题描述】:

我在 Win XP x86 上运行 Python 3.3 和 cx_freeze 3.3 x86。

我有一个安装文件和我的应用程序文件在同一个目录下,安装文件包含以下内容:

import sys
from cx_Freeze import setup, Executable

setup(  name = "Duplicate Finder x86",
    version = "1.0",
    description = "Duplicate Finder x86",
    options = {"build_exe": build_exe_options},
    executables = [Executable("Comparator Source.py", base=base)])

我尝试使用此命令构建:

C:\Documents and Settings\user\Desktop\Construction Yard>C:\Python33\Python setup.py build

我收到此错误:

Traceback (most recent call last):
  File "setup.py", line 7, in <module>
    options = <"build_exe": build_exe_options>,
NameError: name 'build_exe_options' is not defined

我没有使用 cx_freeze 的经验,但我觉得我已经掌握了大部分内容。 关于我缺少什么的任何帮助?

【问题讨论】:

    标签: python-3.x build cx-freeze nameerror


    【解决方案1】:

    我想通了。 我使用的是文档页面上给出的示例设置脚本的修改版本。 我需要删除不必要的部分,将其修改为以下内容:

    import sys
    from cx_Freeze import setup, Executable
    
    setup(  name = "Duplicate Finder x86",
        version = "1.0",
        description = "Duplicate Finder x86",
        executables = [Executable("Comparator Source.py")])
    

    【讨论】:

      猜你喜欢
      • 2021-02-17
      • 1970-01-01
      • 2022-12-02
      • 2013-04-09
      • 1970-01-01
      • 2020-11-07
      • 2017-01-09
      • 2017-06-14
      相关资源
      最近更新 更多