[PyQt] Need help installing PyQt on Snow Leopard

Darren Dale dsdale24 at gmail.com
Fri Dec 18 22:40:06 GMT 2009


Hi Bruce,

On Fri, Dec 18, 2009 at 4:43 PM, Bruce Anderson <bruce306 at rogers.com> wrote:
> I tired the standard instructions from Mark Summerfield's book.  Failed - 64
> bit vs 32 bit.  I successfully installed a new version of Python (2.6.4),
> the XCode from the install disk, Qt (Carbon, I think - 32 bit?),  and SIP.
>  Only PyQt failed.

If you installed python-2.6.4 from a binary distributed by python.org,
then that is probably the source of the problem. Their mac binaries do
not support 64 bits at the time of this writing. I suggest either
using the python that ships with snow leopard or using macports,
depending on your preference.

> Then I found Darren Dale's note from Dec 2nd and tried the .dmg that he
> referenced. (Cocoa? - 64 bit)
> That failed too.  I've confirmed that PyQt has not been successfully
> installed, but at this point, I don't know what kind of a mess I've left my
> machine in.  Do I have to worry about having two versions of Qt on my
> machine? NOTE: I've been in the PC world for decades, but have only been in
> the MAC world since Thursday - so I don't really know my way around yet.
> I have two very explicit questions:
> 1) Can anyone post clear instructions (step by step, including where to put
> things) on how to get PyQt working for the first time on Snow Leopard
> (10.6.1 is what I have).

I don't have time to spell out each step. Here is what I can offer if
you are not using macports or fink:

* for now, use the python installed by snow leopard, not the binaries
distributed at python.org
* 64-bit Qt binary:
http://download.qt.nokia.com/qt/source/qt-mac-cocoa-opensource-4.6.0.dmg

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

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

I've also added the following to my ~/.profile, which distutils
respects when compiling extensions (this is probably not terribly
relevant to PyQt4):

export ARCHFLAGS="-arch x86_64"


I don't have experience with Fink, but as of a few days ago I cleaned
out my system and am now using macports. I am not advocating this
approach, since I don't have enough experience with macports to
provide an informed opinion. But for the record, I made a local port
repository and copied the portfile for qt4-mac-devel (which provides
qt-4.6.0 with support for cocoa) and saved it as qt4-mac (the qt4-mac
port provided by macports should provide qt-4.5.3 but I ran into a
compilation problem with that version:
http://trac.macports.org/ticket/22926). PyQt4 appears to be working
with this installation method.

> 2) Do I have to worry about any messes left behind by the failed install
> attempts?  Does the new install just clean it up?  If YES, how do I go about
> finding the things I have to clean up?

I think the Qt installs probably overwrote each other. But you might
want to delete the old Qt installation (move the folders to the trash)
and reinstall if you continue to have problems. I dont think this
should be necessary.



More information about the PyQt mailing list