python 2.7, import wx says "wrong architecture"

Dave Curtis dave at dave-curtis.com
Thu Mar 22 00:24:43 PDT 2012


So I seem to have partially answered this one myself:
https://trac.macports.org/ticket/31182
the above ticket says how to start with the required python.

So... 

david-curtiss-macbook:capek2 dave$ arch -i386 python2.7
Python 2.7.2 (default, Mar 21 2012, 22:10:23) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> 

Well the above looks good, but the below, not so much....


david-curtiss-macbook:capek2 dave$ arch -i386 idle2.7
** IDLE can't import Tkinter.  Your Python may not be configured for Tk. **

which is very annoying.  Because idle2.7 starts up perfectly fine in 64 bits.

-dave

On Mar 21, 2012, at 11:58 PM, Dave Curtis wrote:

> At this point I'm pretty sure everything is built correctly, but suspect that there is a configuration problem some where.
> 
> When I try 'import wx' in Idle, I get a "wrong architecture' complaint loading wx-2.8-mac-unicode/wx/_core_.so.  The so is built only for i386 -- I thought that was the point of all this ordeal of building universal binaries, that wx is 32 bit only. So it looks like a 32 bit lib.so, but now Python is unhappy with it.
> 
> So... is there still a build issue?  A config issue? Do I need to start Python some special way? other?
> 
> -dave
> 
> Python's complaint:
> 
> Python 2.7.2 (default, Mar 21 2012, 22:10:23) 
> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
> Type "copyright", "credits" or "license()" for more information.
>>>> import wx
> 
> Traceback (most recent call last):
>  File "<pyshell#0>", line 1, in <module>
>    import wx
>  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/__init__.py", line 45, in <module>
>    from wx._core import *
>  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core.py", line 4, in <module>
>    import _core_
> ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core_.so, 2): no suitable image found.  Did find:
> 	/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core_.so: mach-o, but wrong architecture
>>>> 
> 
> And some file information:
> 
> david-curtiss-macbook:wxtab dave$ port provides /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core_.so
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core_.so is provided by: py27-wxpython
> david-curtiss-macbook:wxtab dave$ file /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core_.so
> /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core_.so: Mach-O bundle i386
> 



More information about the macports-users mailing list