我是Python和cx_Freeze的新手。请帮我把它搞定。
运行命令:
python setup.py build
它给了我以下错误。
缺少模块:
?系统从serial.serialcli
导入?从serial.serialposix导入的TERMIOS
? clr从serial.serialcli
导入?从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]
)
答案 0 :(得分:1)
基于this question,您可能需要将这些模块添加到setup.py文件中的includes[]
列表中。
我不记得在使用cx_Freeze时必须这样做,但是一旦我能找到更多信息,我就会编辑这个答案。