Thursday, June 13, 2013

Install PyQt on Mac OSX Lion 10.8.4

I have been searching for ways to successfully install PyQt4 on my macbook pro with Lion 10.8.4. Following are the steps:
source from, thanks to watsy.
1. Download and install Qt: What I downloaded is Qt 5.0.2 for Mac(404MB), Decompress and follow the steps, quite easy.
2. Download SIP:
I download the development snapshots sip-4.14.7-snapshot-74e1df1d9940.tar.gz
Decompress it. Commands in Terminal:
cd sip-4.14.7-snapshot-74e1df1d9940
python -d /Library/Python/2.7/site-packages --arch=x86_64
(change the arch to i386 if your mbp is 32 bits)
sudo make install
3.Download PyQt4:
I downloaded PyQt-mac-gpl-4.10.2-snapshot-11b3001947c9.tar.gz
cd PyQt-mac-gpl-snapshot-4.10.2-ffcf323516fc
python -q /Users/qqli/Qt5.0.2/5.0.2/clang_64/bin/
make -d /Library/Python/2.7/site-packages/ --sip /System/Library/Frameworks/Python.framework/Versions/2.7/bin/sip
sudo make install
After all the steps, you can try from PyQt4 import QtGui if there is no error message, Congratulation. Have fun with PyQt :)