Re: [PyQt] Need help installing PyQt on Snow Leopard

2009-12-19 Thread Darren Dale
On Fri, Dec 18, 2009 at 10:33 PM, Bruce Anderson bruce...@rogers.com wrote:
 Thanks, Darren - That's a good start, and I can try to follow that.

 My first challenge is getting back to the 64 bit python.  (By the way, is
 there a way to tell, once I have it, whether it is 32 bit or 64 bit?)

I guess import sys; print sys.maxint should tell you. It will return
9223372036854775807 for 64 bit and 2147483647 for 32 bit.

 Macport sounds like a WONDERFUL idea!

I agree its a good idea, but is it a good solution in practice? There
may be downsides to using macports, for example if you have to install
something from source that has depends on other packages which you
installed with macports, will you know how to proceed? When I first
started using mac about month ago I asked on this mailing list about
good practices and at one point the conversation turned into a
discussion on the merits of Fink and macports. Someone suggested I try
to do things The Mac Way for a while before embracing Fink or
Macports. I think that was good advice, I learned and tried to make
people aware of what I perceived to be important pitfalls and
workarounds. I also learned that what I missed most, having come from
gentoo linux, was the package manager that helps me keep all of the
open-source software I use up to date.

 I noticed your comments were prefaced
 with if you are not using macports...  I have just installed it, but want
 to do some sanity checks before I start trashing my system.  I did a SEARCH
 and found Python26 - but there is no reference to it being 32 or 64 bit -
 how do I know it is the 'right' (64 bit) one?

check sys.maxint.

 If I understand your notes below, I should macport qt4-mac-devel because
 the qt4-mac is actually 4.5.3 and the one I really want is 4.6.0?

I think py26-pyqt4 depends on the qt4-mac port, which I could not get
to build (probably because I have plenty of cores on my machine, and
it does a parallel build which can sometimes lead to missing symbols
errors in my experience with gentoo.) So you can't just port install
qt4-mac-devel py26-pyqt4, you have to copy the qt4-mac-devel
directory from the macports repository and save it in your local
repository as qt4-mac (don't forget to change the name in the
Portfile). See the macports documentation for details on how to deal
with local repositories.

 I notice that there is also a py26-sip that macport found - I assume that is
 the right one to install after python.

Yes, but I think port install py26-pyqt4 will pull that in for you.

 I also found a macport for py26-pyqt4.  Will macport'ing this complete the
 installation?  (i.e. replace the instructions you gave below?)

It should.

 Sorry to ask so many dumb questions, but the environment is still a bit
 alien to me.

It's ok, but lets try not to spam the list with discussion about OS X
and macports if it is not directly related to PyQt.

Darren

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Need help installing PyQt on Snow Leopard

2009-12-19 Thread Steve Zatz
After switching my OS X Snow Leopard python default to 64-bit with:

defaults write com.apple.versioner.python Prefer-32-Bit -bool no

And then following Darren's directions, everything went fine until PyQt make
install, which proceeded without problem until

ld: library not found for -lqpygui
collect2: ld returned 1 exit status

Googling for lqpygui was not helpful so wondering if anyone has any
thoughts.

Steve
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Need help installing PyQt on Snow Leopard

2009-12-19 Thread Steve Zatz
Never mind.  I switched to the current snapshots and now everything's
working fine.
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Need help installing PyQt on Snow Leopard

2009-12-18 Thread Darren Dale
Hi Bruce,

On Fri, Dec 18, 2009 at 4:43 PM, Bruce Anderson bruce...@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.

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Need help installing PyQt on Snow Leopard

2009-12-18 Thread Bruce Anderson
Thanks, Darren - That's a good start, and I can try to follow that.

My first challenge is getting back to the 64 bit python.  (By the way, is there 
a way to tell, once I have it, whether it is 32 bit or 64 bit?)

Macport sounds like a WONDERFUL idea!  I noticed your comments were prefaced 
with if you are not using macports...  I have just installed it, but want to 
do some sanity checks before I start trashing my system.  I did a SEARCH and 
found Python26 - but there is no reference to it being 32 or 64 bit - how do I 
know it is the 'right' (64 bit) one?

If I understand your notes below, I should macport qt4-mac-devel because the 
qt4-mac is actually 4.5.3 and the one I really want is 4.6.0?

I notice that there is also a py26-sip that macport found - I assume that is 
the right one to install after python.

I also found a macport for py26-pyqt4.  Will macport'ing this complete the 
installation?  (i.e. replace the instructions you gave below?)

Sorry to ask so many dumb questions, but the environment is still a bit alien 
to me.

Bruce





From: Darren Dale dsdal...@gmail.com
To: Bruce Anderson bruce...@rogers.com
Cc: pyqt@riverbankcomputing.com
Sent: Fri, December 18, 2009 5:40:06 PM
Subject: Re: [PyQt] Need help installing PyQt on Snow Leopard

Hi Bruce,

On Fri, Dec 18, 2009 at 4:43 PM, Bruce Anderson bruce...@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.

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt