简体   繁体   English

如何通过cxfreeze用pyqt4模块打包python程序

[英]How to package a python program with pyqt4 module by cxfreeze

I wrote a program using PyQt4.QtGui and QtCore,I packaged it into exe,and it works good on my computer,but it can't run on others' computer 我使用PyQt4.QtGui和QtCore编写了一个程序,将其打包到exe中,在我的计算机上运行良好,但无法在其他计算机上运行

The error is this: 错误是这样的:

cx_Freeze: Python error in main script
---------------------------
Traceback (most recent call last):
  File "C:\Python33\lib\site-packages\cx_Freeze\initscripts\Console3.py", line 27, in <module>
  File "baidu.py", line 6, in <module>
  File "C:\Python\32-bit\3.3\lib\importlib\_bootstrap.py", line 1607, in _handle_fromlist
  File "C:\Python\32-bit\3.3\lib\importlib\_bootstrap.py", line 313, in _call_with_frames_removed
  File "C:\Python\32-bit\3.3\lib\importlib\_bootstrap.py", line 1558, in _find_and_load
  File "C:\Python\32-bit\3.3\lib\importlib\_bootstrap.py", line 1525, in _find_and_load_unlocked
  File "ExtensionLoader_PyQt4_QtGui.py", line 11, in <module>
ImportError: DLL load failed: 找不到指定的模块。

The packaged files are: 打包的文件是:

├─_bz2.pyd
├─_hashlib.pyd
├─_socket.pyd
├─_ssl.pyd
├─baidu.exe
├─icudt49.dll
├─icuin49.dll
├─icuuc49.dll
├─LIBEAY32.dll
├─libGLESv2.dll
├─lxml.etree.pyd
├─PyQt4.QtCore.pyd
├─PyQt4.QtGui.pyd
├─PyQt4.QtNetwork.pyd
├─python33.dll
├─Qt5Core.dll
├─Qt5Gui.dll
├─Qt5Network.dll
├─Qt5PrintSupport.dll
├─Qt5Widgets.dll
├─sip.pyd
├─SSLEAY32.dll
└─unicodedata.pyd

I just used "cxfreeze baidu.py --base-name=Win32GUI --target-dir d:\\123" to package it. 我只是使用“ cxfreeze baidu.py --base-name = Win32GUI --target-dir d:\\ 123”来打包它。 I wonder if I missed some arguments when using cxfreeze result in this problem,and how to package it to exe.Thank you 我想知道使用cxfreeze时是否错过了一些参数,从而导致此问题,以及如何将其打包到exe。谢谢

需要d3dcompiler_43.dll来运行pyqt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM