How to Install PyQt4 on Mac Os X

How to Install PyQt4 on Osx.

Starting from the link given above, I installed PyQt4 on my Mac OS X Snow Leopart machine using Enthought Python Distribution 7 (EPD7).

  1. Download and install Enthought Python Distribution (academic license is the one I can use)
  2. Follow the instructions from the link above. The only differences are the location of the site-packages directory:

In the sip directory:

>> python configure.py -d /Library/Frameworks/Python.Framework/Versions/7.0/lib/python2.7/site-packages –arch i386

>> make

>> sudo make install

and in PyQt directory:

>> python configure.py -q /usr/bin/qmake-4.7 -d /Library/Frameworks/Python.Framework/Versions/7.0/lib/python2.7/site-packages  –use-arch i386

>> make

>> sudo make install

I have to tell that nothing else worked for me: Macports, Homebrew all complained about something but didn’t compile or didn’t link properly. It said the problem is probably withe the way Enthought Python Distribution is installed.

Also follow our renewed and highly active OpenPIV project. We were very lucky to have two great guys working on C++ and Python branches in parallel. We expect many new things coming out soon. Not to forget the 3D-PTV surprises waiting just behind the corner.

6 thoughts on “How to Install PyQt4 on Mac Os X

  1. I’ve just downloaded the latest XCode for Lion and followed your steps above. But when I get to the PyQt make, I get this error:
    /Developer/Tools/Qt/moc -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.8/mkspecs/macx-g++ -I. -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/Library/Frameworks/QtDeclarative.framework/Versions/4/Headers -I/usr/include/QtDeclarative -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I../../QtDeclarative -I. -I. -F/Library/Frameworks -D__APPLE__ -D__GNUC__ qpydeclarative_listwrapper.h -o moc_qpydeclarative_listwrapper.cpp

    Any suggestion?

  2. I have found that PyQt4 when I instal it is picked up by the old Python2.7.3 installation but not Enthought. However other packages I install are picked fine by enthought. Seems to me there is maybe a slight issue both with QT and Enthought.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s