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 -d /Library/Frameworks/Python.Framework/Versions/7.0/lib/python2.7/site-packages –arch i386

>> make

>> sudo make install

and in PyQt directory:

>> python -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. It worked on my Mac THANKS!!!!
    I have Python3.2

  2. 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?

    1. No, unfortunately I do not have any suggestion. I’d suggest to forward this to Qt forum.

  3. 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.

  4. I, i follow your guide but it returns this error, what could i do? error: ‘/usr/bin/qmake-4.7’ is not a file

    1. sorry for that. is there a solution to this?

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close