【发布时间】:2015-09-03 15:56:51
【问题描述】:
我在从 python 和第三方“DLL”生成可执行文件时遇到问题。我正在使用 py2exe。最后我得到一个缺少模块的错误,但该模块是在 DLL 中定义的。
我的 Setup.py 看起来像这样:
from distutils.core import setup
import py2exe, sys, os
import glob
setup(
options = {'py2exe':{ "includes":["clr","openpyxl"]}},
data_files=[('.', glob.glob('XLX2DBC.dll'))],
windows = [{'script': "CANDBCGenerator.py"}],
zipfile = None
)
这有什么问题?
【问题讨论】:
-
你得到的回溯是什么?
-
复制 C:\Python27\DLLs\tcl85.dll -> C:\Users\t7245mh\Desktop\exp\files\dist *** 复制数据文件 *** 复制 XLX2DBC.dll -> C:\Users\t7245mh\Desktop\exp\files\dist\。复制 C:\Python27\lib\site-packages\py2exe\run_w.exe -> C:\Users\t7245mh\Deskt op\exp\files\dist\CANDBCGenerator.exe 以下模块似乎缺少 ['DBVector_DBC', 'ElementC14N', 'Image', 'PIL', '_scproxy', '_sysconfigdata', 'l xml.etree'] *** 二进制依赖 *** 您的可执行文件也依赖于这些不包括在内的 dll,您可能需要也可能不需要分发它们。
-
那是 py2exe 的输出。运行 .exe 时的回溯会很有趣。
-
运行Exe时,出现错误窗口“xxx.exe已停止工作” 一个问题导致程序停止正常工作。请关闭程序。和“关闭程序”按钮。我没有得到跟踪。
标签: python-2.7 dll clr py2exe openpyxl