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.

{ 12 } Comments

  1. Fatal error: Uncaught Error: Call to undefined function ereg() in /home/users4/n/noktec/www/noktec/wp-content/themes/barthelme/functions.php:178 Stack trace: #0 /home/users4/n/noktec/www/noktec/wp-content/themes/barthelme/comments.php(34): barthelme_commenter_link() #1 /home/users4/n/noktec/www/noktec/wp-includes/comment-template.php(1554): require('/home/users4/n/...') #2 /home/users4/n/noktec/www/noktec/wp-content/themes/barthelme/page.php(21): comments_template() #3 /home/users4/n/noktec/www/noktec/wp-includes/template-loader.php(106): include('/home/users4/n/...') #4 /home/users4/n/noktec/www/noktec/wp-blog-header.php(19): require_once('/home/users4/n/...') #5 /home/users4/n/noktec/www/noktec/index.php(17): require('/home/users4/n/...') #6 {main} thrown in /home/users4/n/noktec/www/noktec/wp-content/themes/barthelme/functions.php on line 178