2011-11-09 173 views
10

我是Python和cx_Freeze的新手。請幫助我使它工作。cx_Freeze缺少模塊錯誤

並運行命令:

蟒蛇的setup.py建立

這是給我下面的錯誤。

缺少模塊:

?從serial.serialcli進口的系統

? TERMIOS從serial.serialposix進口

? clr從serial.serialcli進口

? wx從wxversion進口

我正在使用以下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

基於this question,好像你可能需要將這些模塊在你的setup.py文件添加到列表includes[]

我不記得在使用cx_Freeze時不得不這樣做,但是一旦找到更多信息,我將編輯此答案。