PyQt on the Mac: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
Brian Wilson (talk | contribs)
mNo edit summary
Line 7: Line 7:
Then you have to build and install '''PyQT'''.
Then you have to build and install '''PyQT'''.


Sources for both are at [http://www.riverbankcomputing.co.uk/software/ Riverbank]
From http://old.nabble.com/PyQt4,-Qt-on-osx-SnowLeopard-td26394590.html
<pre>
Re: PyQt4, Qt on osx SnowLeopard


Alas PyQT build failed because I have a 10.6 "Snow Leopard" MacBook Pro and the binary I installed from qt.nokia.com is a 32 bit version.
by William Kyngesburye Nov 17, 2009; 10:22am :: Rate this Message: - Use ratings to moderate (?)


Now I am backing off a step and trying to build QT from sources.
Reply | Print | View Threaded | Show Only this Message
Oh MY but this takes a long time!
Here's what I do for using a 32bit Qt 4.5.x (binary distribution), with SIP 3.9 and PyQt 4.6.  The key is to use the new arch flags in the current SIP and PyQt versions.


./configure; make; make install
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=i386 -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=i386
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).
 
</pre>

Revision as of 15:33, 17 May 2010

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.

From http://old.nabble.com/PyQt4,-Qt-on-osx-SnowLeopard-td26394590.html

Re: PyQt4, Qt on osx SnowLeopard

by William Kyngesburye Nov 17, 2009; 10:22am :: Rate this Message: - Use ratings to moderate (?)

Reply | Print | View Threaded | Show Only this Message
Here's what I do for using a 32bit Qt 4.5.x (binary distribution), with SIP 3.9 and PyQt 4.6.  The key is to use the new arch flags in the current SIP and PyQt versions.

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=i386 -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=i386
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).