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