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 http://blog.csdn.net/watsy/article/details/8857252, thanks to watsy.
1. Download and install Qt: http://qt-project.org/downloads What I downloaded is Qt 5.0.2 for Mac(404MB), Decompress and follow the steps, quite easy.
2. Download SIP: http://www.riverbankcomputing.co.uk/software/sip/download
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 configure.py -d /Library/Python/2.7/site-packages --arch=x86_64
(change the arch to i386 if your mbp is 32 bits)
make
sudo make install
3.Download PyQt4: http://www.riverbankcomputing.co.uk/software/pyqt/download
I downloaded PyQt-mac-gpl-4.10.2-snapshot-11b3001947c9.tar.gz
cd PyQt-mac-gpl-snapshot-4.10.2-ffcf323516fc
python configure-ng.py -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
make
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 :)

No comments:

Post a Comment