cx_freeze在构建尝试时产生“NameError:name'build_exe_options'未定义”

时间:2013-06-13 17:29:24

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

我在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的经验,但我觉得我在这里有大部分内容。 关于我缺少什么的任何帮助?

1 个答案:

答案 0 :(得分:0)

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

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")])