[PyQt] PyQt5 and py2exe

Marius Shekow marius.shekow at fit.fraunhofer.de
Tue Dec 1 16:14:36 GMT 2015


Hi Jerome,

some points from my side:
1) Make sure you're not mixing x64 and x86 (32-bit) builds together. 
Everything has to compiled either as x64 or x86.
2) It doesn't matter if your application uses more than one MSVC++ 
redistributable. Our application does that too and it works fine (we 
have MSVS2010 for Python 3.4.3 and a newer MSVS like 2012 or 2013 for 
everything else). However, if I were you I would make the choice of the 
MSVS version that you use depend on the version that Qt was built with. 
E.g. if you downloaded Qt 5.5.1 (you need it to build PyQt anyway) and 
you download the MSVS2013 version, all the compilations you do yourself 
should be done with MSVS2013. When you ship your software, make sure 
that the installer actually (silently) installs the corresponding MSVC 
runtimes (using the redistributable installers)
3) It is correct that DependencyWalker won't find lazily-loaded 
dependencies such as qwindows.dll (or other Qt plugins, in general). 
What you can do is to copy the whole content of e.g. 
C:\Qt\Qt5.5.1\5.5\msvc2012\plugins into the directory where your .exe 
file is located. If the exe then starts as expected, start deleting 
files and dirs (of those that you copied from Qt's plugins directory) 
until the app no longer works properly. Then you'll know which DLLs are 
really required.

Cheers!
Marius

Am 01.12.2015 um 16:47 schrieb Jérôme Godbout:
> Hi,
> Dependency walker only see the .exe direct DLL, those used by Qml are
> not seen and they are the one not found when compiling into Windows 8.1
> on others Windows (8.0-). I use the msvc precompiled Python 2.7.10 (I'm
> stuck in 2.7.x since mercurial module is only compatible for 2.x, no 3.x
> port is available yet) and pip to install most module. I had to compile
> sip and PyQt5 (I only have Visual Studio 2013 here, so it what I used
> for nmake). I known Python 2.7.x used VS2008 for it's compilation, not
> sure if this may cause problems.
>
>   * Python 2.7.10 x64 from binary (VS2008)
>   * sip copmiled using VS2013
>   * PyQt5 compiled using VS2013
>   * Mercurial x64 2.7 from binary
>   * python-hglib from pip
>   * requests from pip
>   * python-redmine from pip
>   * rbtools from pip
>   * Qt5.3 compiled using VS2013
>   * Some C++ Qml plugins compiled into VS2013 (we already have some Qml
>     applications in C++ that use Qt 5.3.0 and wish to use the same
>     plugins here from Python Qml)
>
> For the compilation into Windows 8.1, the generated exe does launch but
> failed to find the qml platform windows.dll even if I put it directly
> into the .exe path I added the relative folder to environment
> var QT_PLUGIN_PATH.
>
> Maybe I should compile a python 2.7.10 using VS2013 (I haven't check
> what it imply and hope I do not have to do this under Windows). Or I may
> wait to move to VS2015, use Python 3.5 and replace the mercurial modules
> usage for full hglib if possible...
>
> This VS dependencies mismatch is a nightmare. 3.4 is VS2010, there's no
> Python version for 2013 it seem.
>
> Thanks for your help,
> Jerome
>
>
>
> On Mon, Nov 30, 2015 at 8:52 PM, michael h <michaelkenth at gmail.com
> <mailto:michaelkenth at gmail.com>> wrote:
>
>
>                     ImportError: DLL load failed: A dynamic link library
>                     (DLL) initialization routine failed.
>
>
>     You can use dependency walker to narrow this kind of problem down.
>
>     Are all the python extensions built using the same toolchain (e.g.
>     msvc vs mingw)?
>
>     (I have an app using pyqt5/py3/py2exe that runs on win 7/8/8.1
>     without issue, so it is possible.)
>
>     - michael
>
>
>
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>

-- 
Marius Shekow
Mixed and Augmented Reality Solutions, Fraunhofer FIT
http://www.fit.fraunhofer.de/mars
Tel.: +49 (0)2241 - 14-2184


More information about the PyQt mailing list