[Baypiggies] Mac users using wxPython
nad at acm.org
Mon Jan 10 19:00:50 CET 2011
On Jan 10, 2011, at 7:56 , Tony Cappellini wrote:
>>I'm not a wxPython user but one thing to watch out for is an
>>architecture mismatch. I see the standard wxPython.org binaries are
>>built for 32-bit Pythons only. So, if you are using a Python 2.7 from
>>a python.org installer, you should be using the 32-bit-only (10.3+)
>>installer variant and not the 64-bit/32-bit (10.6-only) variant.
>I installed Python2.7 via Macports, so there wasn't a installer
>filename which indicated 32/64 bits for it.
>As such, I don't know which architecture it is using.
>I downloaded the wxPython installer from Python.org though- maybe
>there is a mismatch.
I'm assuming you mean you downloaded wxPython from wxpython.org, not to
be confused with the Python Software Foundation's python.org.
If you are running on OS X 10.6 and on a 64-bit-capable processor
(pretty much any Mac made in the last 3 years or so), by default
MacPorts will have installed either a 64-bit version or a multi-arch
("universal") version that OS X will prefer to run as 64-bit:
$ file /opt/local/bin/python2.7
/opt/local/bin/python2.7: Mach-O universal binary with 2 architectures
/opt/local/bin/python2.7 (for architecture x86_64): Mach-O 64-bit
/opt/local/bin/python2.7 (for architecture i386): Mach-O executable i386
I am a fan of MacPorts for a lot of things but, if you are are going to
use the wxPython installer, life will probably be a lot easier if you
stick to the 32-bit python2.7 python.org installer because the wx
version from their installer was built to be compatible with it.
There's no reason you can't have both versions of python2.7 installed,
though. There's no ambiguity as each instance's files, including
site-packages, are installed in separate locations. For instance:
$ /opt/local/bin/python2.7 -c 'import sys;print(sys.executable)'
$ /usr/local/bin/python2.7 -c 'import sys;print(sys.executable)'
On the other hand, MacPorts appears to have its own ports of wxPython
available. So you could try that out, too:
$ sudo port selfupdate
$ sudo port install py27-wxpython
nad at acm.org
More information about the Baypiggies