我正在尝试冻结我的 Python3.2 项目并在运行生成的可执行文件后出现以下错误:
调用 format_exception 时引发异常。“str”对象没有属性“__cause__”。原始例外:无法导入名称格式。
该项目具有三个带有 __init__.py 文件的内部包/模块。它使用外部包:sqlite3、PyQt4、matplotlib、numpy、scipy。
这是我的 setup.py:
from cx_Freeze import setup, Executable
includes = ['re', 'PyQt4', 'os', 'scipy', 'csv', 'sqlite3', 'itertools', 'numpy', 'sys', 'matplotlib']
excludes = []
packages = []
path = []
GUI2Exe_Target = Executable(
# what to build
script = "xshape_report.py",
#initScript = None,
base = 'Win32GUI',
#targetDir = r"dist",
#targetName = "xshape_report.exe",
#compress = True,
#copyDependentFiles = True,
#appendScriptToExe = False,
#appendScriptToLibrary = False,
icon = None
)
setup(
version = "0.1",
description = "Reporting system",
author = "Katya",
name = "Xshape report",
options = {"build_exe": {"includes": includes,
"excludes": excludes,
"packages": packages,
"path": path
}
},
executables = [GUI2Exe_Target]
)
如果我离开,同样的错误包括空。可能是什么原因?