Skip to content

How to Install PyQt4 on OS X

Note : this is a tutorial on Mac OS X 10.6.4, with : PyQt-mac-gpl-snapshot-4.7.5-8a6793a155e0.tar.gz and with : sip-4.11-snapshot-052b642f04a8.tar.gz.
It should be the same on previous and next versions. ( if you have some bugs you may also contact me )

How to install PyQt4 ?

  1. Download the SIP package (snapshot for OS x )
  2. Download the PyQt package (snapshot for OS x)
  3. Download Qt
  4. Install Qt
  5. Install SIP
  6. Install PyQt
  7. and try !

Let’s download the Qt binary from the website : Download site (You may take the complete SDK)

Let’s download the SIP snapshot : Download site (for OS x)

Let’s download the PyQt snapshot : Download site (for OS x)

And now let’s install the first Qt binary, just follow and click on next until it as finished to install.


SIP is the program that bind C++ with Python

let’s  go were you have downloaded the sip tar.gz and enter the folder

and we are gonna try to install it with the following lines :

— arch i386 is to specify that we want this architecture

then lets make it and install it with the following commands :


Once installed let’s move back an go to the PyQt folder to configure it and install it with the following command :

and let’s try to configure it with the right things

then let’s make them with:

and now, everything should be Up and running.


In OS X Lion and with the new versions there is a thread on QT website which says that qmake-4.7 is hidden in /usr/bin. Could someone confirm that it works.

EDIT 2013 :

Many of you happen to have problems installing PyQT and ask me questions about the installation process and errors, via e-mails, or in the comment section, please note that I can’t answer all of them, although, if you find a fix to your problem, please  let me know, or add a comment with the fix !  You are probably not the only one with the problem. 

Randall Munroe : xkcd: Wisdom of the Ancients

Randall Munroe : xkcd: Wisdom of the Ancients

Edit 09/13 : 

If you previously encountered the following issue :

It might have been because the versions in this tutorial had not been updated, however, thanks to Rick’s comment the changes have now been made. The versions in the post are now Python 2.7, Qmake 4.8 and the architecture was changed from ‘i386 to x86_64’.


Edit 01/14 :

If the above didn’t worked for you or if you want a simpler way to install PyQT4 / 5 on OS X  you can use homebrew.  Once brew installed, simply type the following commands in your terminal :

And that should work for you as well.

{ 11 } Comments

  1. Hugh Brown | 1 June 2015 at 18 h 45 min | Permalink

    It seems to be easier than that. brew install PyQt installs the dependencies qt and sip:

    {15-06-01 11:00}Hughs-MBP:/usr/bin hughdbrown% brew install PyQt
    ==> Installing dependencies for pyqt: qt, sip
    ==> Installing pyqt dependency: qt

    pyqt takes about 4 minutes to build and Qt takes about 21 minutes.

  2. enedil | 10 July 2015 at 11 h 17 min | Permalink

    If you simply use
    brew install pyqt
    it will pull qt and sip.

  3. Noktec | 10 July 2015 at 11 h 34 min | Permalink

    I know guys, but the post has been created a few years ago.

    Although, you’r right, now using brew works faster and obviously better.

    Thanks for the comment though.

  4. cotique | 8 December 2015 at 17 h 45 min | Permalink

    god bless homebrew! thanks for your article

  5. Petter | 8 April 2016 at 15 h 24 min | Permalink

    The installation fails as the root user on my Mac OS X (10.11 El Capitan) cannot write anything to the /System folder. Not sure if this is related to my machine or is a change from Apple or something else.

  6. soedr | 1 May 2016 at 20 h 37 min | Permalink

    I realize this post was written a while back, but am in a pinch so am asking anyway.

    I was able to install using brew, but when I try to import PyQt4 I get an error saying the module is not available.

    What might be the problem?

  7. Hongbin Yang | 23 August 2016 at 13 h 14 min | Permalink

    If you install by brew install pyqt, you may not be able to import PyQt4 because of PATH

    My suggest is :

    mkdir -p /Users/zgf/Library/Python/2.7/lib/python/site-packages
    echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/zgf/Library/Python/2.7/lib/python/site-packages/homebrew.pth

    Change the username zgf into yours in MacOS.
    Also /Library/Python/site-packages is an alternative if you have root.

  8. Ayser | 10 November 2016 at 8 h 28 min | Permalink

    brew is a great tool
    thank you so much
    you’ve saved my time

  9. Noktec | 20 November 2016 at 14 h 03 min | Permalink

    Your welcome 😉 thanks for the comment !

  10. Adin Horovitz | 15 March 2017 at 22 h 28 min | Permalink

    I spent a lot of time trying the original method. I think the rootless mode on newer macs prevents the SIP make process from working. After struggling for an hour, I found the update with brew instructions. I wish the brew method was at the top.

  11. Miftahuddin | 9 April 2017 at 8 h 37 min | Permalink

    So, how do I use it after successful installation?

Post a Comment

Your email is never published nor shared. Required fields are marked *