[Pythonmac-SIG] "mach-o, but wrong architecture"

Bob Ippolito bob at redivi.com
Sat Mar 25 18:24:22 CET 2006


On Mar 24, 2006, at 4:51 PM, Marc Hedlund wrote:

> I've seen a few messages about this error, but I'm not clear what the
> resolution is (if any).  I'm using MacOS X 10.4.5, Intel iMac, and the
> bundled Python 2.3.5.  For various reasons I don't want to use  
> Python 2.4
> yet.
>
> I had been working along just fine using Python and wxPython, until  
> I hit
> a problem with wxPython today.  I realized that I was using an old  
> version
> of wxPython, 2.5.3.1, and that it didn't support a feature I  
> needed.  So I
> downloaded wxPython 2.6.2.1, along with the  
> TigerPython23Compat.pkg, and
> installed them both.
>
> Now when I try to run python and import wx, I get this error:
>
>>>> import wx
> Traceback (most recent call last):
>    File "<stdin>", line 1, in ?
>    File "//Library/Python/2.3/wx-2.6-mac-unicode/wx/__init__.py",  
> line 42, in ?
>      from wx._core import *
>    File "//Library/Python/2.3/wx-2.6-mac-unicode/wx/_core.py", line  
> 4, in ?
>      import _core_
> ImportError: dlopen(/Library/Python/2.3/wx-2.6-mac-unicode/wx/ 
> _core_.so, 2): no suitable image found.  Did find:
>          /Library/Python/2.3/wx-2.6-mac-unicode/wx/_core_.so: mach- 
> o, but wrong architecture
>
> I get that wxPython is built for ppc, and that the version of  
> python on my
> machine is a Universal binary, and that those aren't playing well
> together.  My question is, can I do anything about it?  Is there a  
> way to
> call python so that it is forced to run under Rosetta?  My goal is  
> to run
> Python 2.3 and wxPython 2.6 on the Intel iMac.  Is that possible yet?

The best way to do this is to install the PPC version of Python 2.4  
and use that to use PPC extensions.  You really don't want to be  
using that build of Python anyway, Apple missed a bunch of things  
when they tried to port it to i386 (and they're very unlikely to  
correct their mistakes because they have a record of never updating  
Python except on major OS releases).

-bob



More information about the Pythonmac-SIG mailing list