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 1: Line 1:
Still working on this article... not sure how things will shake out yet. Come back tomorrow.
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.
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.
There is no Mac binary installer for PyQT.


First you have to build and install '''SIP'''. SIP is a tool for creating C/C++ bindings.
I went down the path of installing the first copy of QT that I found at their site, then tried to build and install PyQT only to have it gripe that the QT installation was 32-bit.  


Then you have to build and install '''PyQT'''.
Then I found that there are 64-bit versions of the QT binaries tucked away [http://qt.nokia.com/downloads/mac-os-cpp here].


For QT:
But for some reason installing those did not help either.


export CCFLAGS="--arch=x86_64"
== Building QT 4.6.2 for 64-bit ==
  ./configure
 
  ./configure -arch X86_64
  make
  make
  sudo make install
  sudo make install
unset CCFLAGS


For QT Creator:
== Building PyQT ==


export CCFLAGS="--arch=x86_64"
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'''.
./configure
make
sudo make install
unset CCFLAGS


For SIP:
For SIP:
Line 36: Line 34:
  make
  make
  sudo make install
  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:42, 18 May 2010

Still working on this article... not sure how things will shake out yet. Come back tomorrow.

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 Mac binary installer for PyQT.

I went down the path of installing the first copy of QT that I found at their site, then tried to build and install PyQT only to have it gripe that the QT installation was 32-bit.

Then I found that there are 64-bit versions of the QT binaries tucked away here.

But for some reason installing those did not help either.

Building QT 4.6.2 for 64-bit

./configure -arch X86_64
make
sudo make install

Building PyQT

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