cx_Freeze缺少模块错误

13

我刚学Python和cx_Freeze,请帮助我使其工作。

运行以下命令:

python setup.py build

它给出了以下错误信息。

缺少模块:

? 从serial.serialcli导入的System

? 从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]
    )
1个回答

1

根据这个问题,看起来你可能需要将这些模块添加到你的setup.py文件中的includes[]列表中。

我记不得在使用cx_Freeze时需要这样做,但是一旦我找到更多信息,我会编辑这个答案。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接