可执行文件在我构建它的系统上运行完美,但在我试过的其他系统上崩溃时出现以下错误......
Traceback(most recent call last):
File "C:\Python34\lib\site-packages\cx_freeze-4.3.3-py3.4-win32.egg\cx_freeze\initscripts\Console.py", line 27, in <module>
File "monitor edi.py", line 1, in <module>
File "C:\Python34\lib\importlib\_bootstrap.py", line 2214, in find and load
File "C:\Python34\lib\importlib\_bootstrap.py", line 2203, in find and load_unlocked
File "C:\Python34\lib\importlib\_bootstrap.py", line ll91, in load unlocked
File "C:\Python34\lib\importlib\_bootstrap. py", line l l 6 l , in _load_backward_compatible
File "C:\Apps\cars\Code\cars utils.py", line 7, in <module>
File "C:\Python34\lib\importlib\_bootstrap.py", line 2261, in handle fromlist
File "C:\Python34\lib\importlib\_bootstrap.py", line 321, in call with frames_removed
File "C:\Python34\lib\importlib\_bootstrap.py", line 2214, in find and load
File "C:\Python34\lib\importlib\_bootstrap.py", line 2203, in find and load_unlocked
File "C:\Python34\lib\importlib\_bootstrap.py", line ll91, in load unlocked
File "C:\Python34\lib\importlib\_bootstrap.py", line ll61, in load_backward_compatible
File "ExtensionLoader_PyQt5_QtCore.py", line 22, in <module>
File "ExtensionLoader_PyQt5_QtCore.py", line 14, in __bootstrap__
ImportError: DLL load failed: The specified module could not be found.
我已经阅读了一些遗漏的DLL问题,如QWindows.DLL和libEGL.dll,但是看起来cx_Freeze-4.3.3修复了这些问题,因为这些dll包含在构建文件夹中。
内置32位Python 3.4,使用PyQt 5.3和cx_Freeze 4.3.3
以下是构建文件夹
中的文件列表icudt49.dll
icuin49.dll
icuuc49.dll
libEGL.dll
libGLESv2.dll
library.zip
monitor_edi.exe
msvcr100.dll
pyexpat.pyd
pyodbc.pyd
PyQt5.QtCore.pyd
PyQt5.QtGui.pyd
PyQt5.QtWidgets.pyd
python34.dll
pywintypes34.dll
Qt5Core.dll
Qt5Gui.dll
Qt5Widgets.dll
qwindows.dll
select.pyd
sip.pyd
tcl86t.dll
tk86t.dll
unicodedata.pyd
win32api.pyd
win32crypt.pyd
_bz2.pyd
_ctypes.pyd
_decimal.pyd
_hashlib.pyd
_lzma.pyd
_socket.pyd
_ssl.pyd
_tkinter.pyd
有任何想法/建议/问题吗?
答案 0 :(得分:2)
您需要确保cx_Freeze包含atexit
模块。我不清楚为什么会这样,但the cx_Freeze PyQt example包括这个。如果您使用的是cxfreeze
脚本,则可以使用--include=atexit
选项确保这一点。如果你从你自己的setup.py脚本调用cx_Freeze,它可能看起来像这个代码改编自我自己正在进行的工作:
import sys
from cx_Freeze import setup, Executable
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
setup(name = 'spamandeggs',
version = '0.0.1',
executables = [Executable('spamandeggs.pyw', base=base)],
options = {'build_exe': {'includes': ['atexit']}})
顺便提一下,如果您使用的是PyQt5.Qsci
插件,则还需要明确包含PyQt5.QtPrintSupport
。而且我发现在cx_Freeze完成它之后我仍然需要复制libEGL.dll
,但我也使用cx_Freeze 4.3.3所以我不确定为什么会这样。
答案 1 :(得分:0)
我今天遇到了同样的错误,经过一整天的搜索后终于找到了解决方案。 我复制了msvcp100.dll,一切正常。
WFT