【问题标题】:cx_Freeze missing modules errorcx_Freeze 缺少模块错误
【发布时间】:2011-12-25 00:11:52
【问题描述】:

我是 Python 和 cx_Freeze 的新手。请帮助我让它工作。

然后运行命令:

python setup.py 构建

它给了我以下错误。

缺少模块:

?从serial.serialcli导入的系统

?从serial.serialposix导入的TERMIOS

?从serial.serialcli导入的clr

?从 wxversion 导入的 wx

我正在使用以下 setup.py 文件。

# Let's start with some default (for me) imports...

from cx_Freeze import setup, Executable

# Process the includes, excludes and packages first

includes = []
excludes = ['_gtkagg', '_tkagg', 'bsddb', 'curses', 'email', 'pywin.debugger',
        'pywin.debugger.dbgcon', 'pywin.dialogs', 'tcl',
        'Tkconstants', 'Tkinter']
packages = []
path = []

GUI2Exe_Target_1 = Executable(
    # what to build
    script = "..\esp\main.py",
    initScript = None,
    base = 'Win32GUI',
    targetDir = r"dist",
    targetName = "acup_new.exe",
    compress = True,
    copyDependentFiles = True,
    appendScriptToExe = False,
    appendScriptToLibrary = False,
    icon = None
    )

setup(

    version = "0.1",
    description = "No Description",
    author = "No Author",
    name = "cx_Freeze Sample File",

    options = {"build_exe": {"includes": includes,
                 "excludes": excludes,
                 "packages": packages,
                 "path": path
                 }
           },

    executables = [GUI2Exe_Target_1]
    )

【问题讨论】:

    标签: python cx-freeze


    【解决方案1】:

    基于this question,您可能需要将这些模块添加到您的 setup.py 文件中的includes[] 列表中。

    我不记得在使用 cx_Freeze 时必须这样做,但我会在找到更多信息后编辑此答案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-03
      • 2020-01-30
      • 2020-04-10
      • 1970-01-01
      • 2018-04-03
      • 2014-10-03
      • 2018-06-22
      • 2016-03-11
      相关资源
      最近更新 更多