On 6/06/2010 7:23 PM, Timothée Lecomte wrote:
> Dear py2exe users,
> I have a PyQt application, and I am building a Windows executable using
> py2exe. The setup.py was working perfectly up to recently, when I started
> to have a non-functional executable that always gave the following error
> File "QtGui.pyc", line 12, in<module>
> File "QtGui.pyc", line 10, in __load
> ImportError: DLL load failed: The specified procedure could not be found.
> Using Dependency Walker, it turned out that py2exe put the wrong dlls for
> QtGui4.dll and QtCore4.dll. Instead of picking those in
> C:\Python26\Lib\site-packages\PyQt4 (version 4.5.2), it chose to pick
> those from a MikTeX installation in C:\Program Files\MiKTeX 2.8\miktex\bin
> (version 4.6.0) which turns out to be in the Windows Path too.
> How can I workaround this (apart from manually copying the right dlls each
> time I execute the setup.py script) ?
Easiest is probably to run py2exe with a modified PATH which doesn't
include that second directory.
> Should this be regarded as a bug in
> py2exe ?
Possibly - py2exe should select the same module Python itself would
select at runtime - however, I seem to recall PyQt itself relies on the
PATH for this to work. Can you work out how Python manages to use that
PyQt directory instead of the MikTex one?