cx_Freeze 缺失模块错误
我刚接触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的时候并不需要这样做,不过等我找到更多信息后会更新这个回答。