[PyQt] PyQt5 for Python 2.7 on Windows 10

Nathan Warmerdam nbwarmerdam at integrated-informatics.com
Fri Jun 2 23:28:46 BST 2017


I rebuilt using the arguments you suggested unfortunately that build simply did not work at all for me (imported but crashed when creating a QApplication).  

At this point I guess I’ll just continue to tinker with things on Windows 10 though I don’t really have a lot of ideas left.  I’m not really trying to build a wheel just trying to get it to behave so I can deliver it along-side my packages.  We don’t really install packages to python, our solutions are “add-ins” to mapping software which act basically like a drop in, as in you put it somewhere and the main application runs it from there.  Happy it works in Windows 8 but mystified that it will not work on Windows 10.

Thanks again for your ideas.
Nathan


On 5/31/17, 10:55 AM, "Phil Thompson" <phil at riverbankcomputing.com> wrote:

    On 31 May 2017, at 6:40 pm, Nathan Warmerdam <nbwarmerdam at integrated-informatics.com> wrote:
    > 
    > Hi Phil,
    > 
    > We have a commercial license of Qt.  On our build machine (windows 8.1 with VS 2015) I did the following:
    > - Installed Qt 5.8 (msvc2015) 
    > - pulled down the PyQT5 5.8.2 Commercial source code 
    > - sip 4.19.2. source code
    > 
    > I then successfully built sip and PyQt5 for python 2.7.  In an effort to make my build of PyQt5 independent of a Qt install I did the following:
    > - Copy the relevant qt dlls to a sub folder PyQt5/Qt/bin
    > - Copy the relevant qt plugins and qml files to PyQt5/Qt/plugins and PyQt5/Qt/qml respectively
    > - Copy the windows redistributables (concrt140.dll, msvcp140.dll, vccorlib140.dll, vcruntime140.dll) to PyQt5/Qt/bin
    > - Create a qt.conf in the bin folder that contains just:
    > [Paths]
    > Prefix = ..
    > - Modified PyQt5 __init__.py per my original email.
    > 
    > I took this PyQt5 folder over to a separate “clean” machine (no Qt installed, no PyQt soruce code) with python 2.7 installed and tested that it worked (the dependency had been broken).   My tests were successful on this test machine which happened to also be Windows 8.1.  I actually tested it on numerous clean Windows 8.1 machines with no trouble.
    > I then dropped this package onto a Windows 10 machine and ran my tests and that is when I ran into this problem.
    > 
    > The only reason I adopted the PyQt5/Qt/.. structure is because I noted that this is what the PyQt5 Python 3 GPL version appears to do when installed by pip.  I had hoped there was some magic to that setup.
    
    The location and content of your qt.conf doesn't look right. PyQt's configure.py takes a --qtconf-prefix option which will embed a qt.conf in the QtCore module. From memory I think the value to pass is Qt/bin. The wheels use this to find the Qt installation in the wheel.
    
    However, as far as I can tell, that doesn't explain why it currently works on Windows 8.
    
    Phil



More information about the PyQt mailing list