Last active
March 1, 2023 01:44
-
-
Save iddm/e01ab56d28a2c9467cc6 to your computer and use it in GitHub Desktop.
Install PyQt5 to Mac OS X Yosemite with python3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This snippet tested on Yosemite 10.10.1 | |
1. Define your python3 directory (for example, "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/") | |
2. Download "http://download.qt-project.org/official_releases/qt/5.3/5.3.2/qt-opensource-mac-x64-clang-5.3.2.dmg" or any other new version of qt for mac and install it. | |
3. Download SIP sources here: http://www.riverbankcomputing.com/software/sip/download | |
4. Download PyQt5-gpl sources here: http://www.riverbankcomputing.com/software/pyqt/download5 | |
5. Go to your downloads by terminal (for example, "cd ~/Downloads") | |
6. tar xvf PyQt-gpl-5.3.2.tar.gz | |
7. tar xvf sip-4.16.4.tar.gz | |
8. cd sip-4.16.4/ | |
9. python3 configure.py -d /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3//site-packages --arch x86_64 | |
10. make | |
11. sudo make install | |
12. sudo make clean | |
13. Change line "!host_build:QMAKE_MAC_SDK = macosx10.8" to "!host_build:QMAKE_MAC_SDK = macosx10.10" in ~/Qt5.3.2/5.3/clang_64/mkspecs/qdevice.pri | |
14. cd ../PyQt-gpl-5.3.2/ | |
15. python3 configure.py --destdir /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages --qmake ~/Qt5.3.2/5.3.2/clang_64/bin/qmake | |
16. make | |
17. sudo make install | |
18. sudo make clean |
Edited the sipQtCoreQt.cpp and removed the 2 offending lines.
http://patchwork.ozlabs.org/patch/720187/
This worked fine on ubuntu.
This patch gave me the confidence that I wasn't totally messing up my computer.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ok, this worked for my macOS 10.12.2 / Qt 5.80 / PyQt5.7.1 / sip 4.19 / Python3.5 installation up until step 13.
The file ~/Qt5.3.2/5.3/clang_64/mkspecs/qdevice.pri however did not contain any !host reference and simply adding it myself did not help.
Then I found this post on Stack Overflow. It stated I should run:
which worked like a charm all the way up to step 15.
During step 15 however, I received the error:
I was able to fix that error by commenting out some lines in PyQt5 configure.py as instructed here.
Then, I continued and the command from step 15 executed without a problem.
However, now, when I run make (step 16) I am receiving this error:
Does anyone have any idea how to fix this?