The wxPython 2.8 (and earlier) series are limited to 32-bit because they are built upon the Carbon library and Apple did not release their 64-bit version of Carbon. You are likely running a 64-bit Python and so it is trying to load the 64-bit version from the extension moudles, but there isn't one. Hence, "no matching architecture in universal wrapper"
To work around this you can simply force Python to run in 32-bit mode, and since you appear to be using Python 2.7 there should be a "python2.7-32" command that you can run that will do that for you. If you don't like giving up the 64-bit Python an alternative would be to download and install the "cocoa" version of wxPython from the 2.9 release series.
···
On 8/27/11 3:12 PM, Alex Bridgland wrote:
Hi,
I hope I am not bothering too many people, and I hope I am not being
stupid - I am pretty inexperienced with python in general so I might
be a bit out of my depth. However, my problem is occurring whenever I
try to run a .py file in my mac's terminal which uses wxPython. I
wrote the following script based on a introductory tutorial:import wx
app = wx.PySimpleApp()
frame = wx.Frame(None,-1,"Hello World")
frame.Show(1)
app.MainLoop()I then proceed to run it like any other .py file and the following is
printed to my terminal:ABRIDGLANDMAC:Python alexbridgland$ python wxTest1.py
Traceback (most recent call last):
File "wxTest1.py", line 1, in<module>
import wx
File "/usr/local/lib/wxPython-unicode-2.8.11.0/lib/python2.7/site-
packages/wx-2.8-mac-unicode/wx/__init__.py", line 45, in<module>
from wx._core import *
File "/usr/local/lib/wxPython-unicode-2.8.11.0/lib/python2.7/site-
packages/wx-2.8-mac-unicode/wx/_core.py", line 4, in<module>
import _core_
ImportError: dlopen(/usr/local/lib/wxPython-unicode-2.8.11.0/lib/
python2.7/site-packages/wx-2.8-mac-unicode/wx/_core_.so, 2): no
suitable image found. Did find:
/usr/local/lib/wxPython-unicode-2.8.11.0/lib/python2.7/site-packages/
wx-2.8-mac-unicode/wx/_core_.so: no matching architecture in universal
wrapper
ABRIDGLANDMAC:Python alexbridgland$Sorry it is so messy... But I am stuck. The wxPython installation
seems to have worked since I can run the demos in the demo download
within the wxPython demo app. Is there anything you can suggest to fix
this? Anything at all would be hugely appreciated. I would really
rather not have to use tkInter which is working.
--
Robin Dunn
Software Craftsman