I build one code and then created a exe from .py using py2exe .
Now i want to create a self expracted for the same so i used Iexpress to do that . I am able to create the exe from Iexpress but when i try to extract my application from the exe created i get following error :
Traceback (most recent call last):
File "C.py", line 44, in <module>
File "A.pyc", line 4, in <module>
File "PyQt4\QtGui.pyc", line 12, in <module>
File "PyQt4\QtGui.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be found.
It seems , error is all coming in line :
from PyQt4 import QtCore, QtGui
I saw some ways to fix this on internet but couldnt succeed to fix this . Anyone have any ideas ?
I tried to reproduce this here, but it seems to work fine. Here's what I did:
Created a file
hello-pyqt.pyusing this question: How to implement a simple button in PyQtCreated a
setup.py:The
dll_excludesandincludestricks came from an answer on py2exe fails to generate an executable and this Py2exeAndPyQt page, respectively.Executed
setup.py:Tested the output before using IExpress:
Bundled it with IExpress in the usual way:
hello-pyqt.exeandlibrary.zip.hello-pyqt.exe.Compare your process with the one I'm using (above) and see if there's anything that might help. Failing that, I'd use Process Monitor to see which DLL it's failing to load and where it's looking.
The DLLs that are bundled in my
library.zipare:QtCore4.dllandQtGui4.dll. You might want to check yourlibrary.zipto make sure those files are there.