I am experiencing trouble trying to get the combination of Qt 5.8.0 / PyQt 5.7.1 / sip 4.19 / Python3.5 to install & work correctly on my macOS 10.12.2 (Sierra).
Steps to reproduce the problem:
(I am being very specific for if anyone else will ever venture here trying to accomplish the same thing)
- Install Python3.5 via homebrew (brew install python3.5).
- Installing PyQt5 via homebrew however did not work as my python code complained that it could not find the pyqt module. I fixed it by applying some symlinks. Yet, the code remained buggy throwing up errors like QtGui.QApplication was missing etc. I also found multiple complains of macOS users that had run into similar problems but I could not find any real solution. So, I removed all my symlinks and ran
brew uninstall pyqt5
. - Then I found this gist on GitHub, and started following that so I:
- Downloaded qt-opensource-mac-x64-clang-5.8.0.dmg from qt-project.org
- Downloaded SIP and PyQt5-gpl sources as mentioned in the gist.
I then unpacked the SIP & PyQt5 tar files. Then I executed the command:
python3.5 ~/Downloads/sip-4.19/configure.py -d /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages --arch x86_64
So far, so good. Also
make
,sudo make install
&sudo make clean
, as mentioned in the gist, executed without a problem.- Now, I arrived at step nr. 13 from the gist, which told me to make a small change to the
!host_build
command listed in the~/Qt5.8.0/5.8/clang_64/mkspecs/qdevice.pri
file. The file however did not mention any!host_build
comment at all, so I added one myself. Then, at step 15 from the gist I executed:
python3.5 configure.py --destdir /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages --qmake ~/Qt5.8.0/5.8/clang_64/bin/qmake
This gave a SDK path error, which I fixed by running
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
as per instruction on this post on Stack from people that ran into a similar problem.Now, the code mentioned above in step 10 did execute, but it threw up an error:
Error: This version of PyQt5 and the commercial version of Qt have incompatible licenses
So, I searched and arrived at a post on the QT forum. It helped me solve the error by making some small adjustments to PyQt5's configure.py file (commenting out the license check).
- Then, I was finally able to successfully run the command I mentioned at step 10 (step 15 from the gist).
However, when I tried to run
make
again, everything seems to be going perfect until it now throws out this error that, so far, I have not been able to fix:~/Downloads/PyQt5_gpl-5.7.1/QtCore/sipQtCoreQt.cpp:1093:62: error: no member named 'WindowCancelButtonHint' in namespace 'Qt'; did you mean 'WindowCloseButtonHint'? {sipName_WindowCancelButtonHint, static_cast<int>( ::Qt::WindowCancelButtonHint), 419}, ~~~~~~^~~~~~~~~~~~~~~~~~~~~~ WindowCloseButtonHint ../../../Qt5.8.0/5.8/clang_64/lib/QtCore.framework/Headers/qnamespace.h:300:9: note: 'WindowCloseButtonHint' declared here WindowCloseButtonHint = 0x08000000, ^ ~/Downloads/PyQt5_gpl-5.7.1/QtCore/sipQtCoreQt.cpp:1106:58: error: no member named 'WindowOkButtonHint' in namespace 'Qt' {sipName_WindowOkButtonHint, static_cast<int>( ::Qt::WindowOkButtonHint), 419}, ~~~~~~^ 2 errors generated. make[1]: *** [sipQtCoreQt.o] Error 1 make: *** [sub-QtCore-make_first-ordered] Error 2
Is there anyone able to help me out?