PyQt on the Mac

From Wildsong
Revision as of 15:46, 17 May 2010 by Brian Wilson (talk | contribs)
Jump to navigationJump to search

PyQt is a set of bindings for Python that allow you to build applications using the QT framework. So, in theory you can build one application that runs on any platform that supports Python and QT. This includes Macintosh, Linux, and Windows.

There is no binary installer for Macintosh.

First you have to build and install SIP. SIP is a tool for creating C/C++ bindings.

Then you have to build and install PyQT.

For QT:

export CCFLAGS="--arch=x86_64"
./configure
make
sudo make install
unset CCFLAGS

For QT Creator:

export CCFLAGS="--arch=x86_64"
./configure
make
sudo make install
unset CCFLAGS

For SIP:

export MACOSX_DEPLOYMENT_TARGET=10.6
python configure.py -n -d /Library/Python/2.6/site-packages -b /usr/local/bin -e /usr/local/include -v /usr/local/share/sip --arch=x86_64 -s MacOSX10.6.sdk
make
sudo make install

For PyQt:

export QTDIR=/Developer/Applications/Qt
python configure.py -d /Library/Python/2.6/site-packages -b /usr/local/bin --use-arch=x86_64
make
sudo make install

You will get a lot of warnings about "Support for this version of Mac OS X is still preliminary", but they're harmless (so far).