0
我有一個非常龐大的python腳本,我試圖cx_freeze,但是當我運行可執行文件時,我不斷收到相同的錯誤,它似乎與docx模塊有關。Cx_freeze exe文件未能完全導入docx
我在Windows 8.1機器上使用Python 3.3.5和docx 0.7.6-py33。
這是我的設置腳本。
from cx_Freeze import setup, Executable
includefiles = ['logo.ico','db.db','dbloc.bin']
includes = []
excludes = []
packages = ['tkinter','docx','sys', 'sqlite3', 'os', 'hashlib', 'random', 'uuid', 'base64', 'tempfile', 'win32api',
'winreg', 'ntplib', 'winsound', 'time', 'csv', 'webbrowser', 'inspect','datetime', 'decimal', 'ctypes',
'win32com.client','operator']
exe = Executable(
# what to build
script = "NEPOS.py",
initScript = None,
base = 'Win32GUI',
targetName = "Nepos.exe",
copyDependentFiles = True,
compress = True,
appendScriptToExe = True,
appendScriptToLibrary = True,
icon = 'Icon.ico'
)
setup(
name = "MyProgram",
version = "1.0.0",
description = 'Description',
author = "Joe Bloggs",
author_email = "[email protected]",
options = {"build_exe": {"excludes":excludes,"packages":packages,
"include_files":includefiles}},
executables = [exe]
)
這是我得到的錯誤。
它看起來就像是有屬於DOCX很難找到方法,但我的源代碼調用import docx
,它被列爲安裝文件的相關模塊,所以我不知道爲什麼他們AREN不包括在內。
它包含了lxml的一部分,但它錯過了它需要包含的另一部分。 –
我還注意到,docx模板不包含在由cx_freeze創建的'library.zip'中。編輯這個庫後凍結給我更多的錯誤,所以我直接移動了模板(這只是一個空白的docx文件),直接打開它,而不是隻是'document()'。 –
嗨,我知道我遲到了,但你是怎麼做到的? @I_do_python – aaossa