unable to run wxPython on Lion

2,120 views
Skip to first unread message

Alex Hall

unread,
Oct 3, 2011, 11:18:11 AM10/3/11
to wxpytho...@googlegroups.com
Hi all,
I am trying to run a program using wxPython on Lion. I get a strange traceback:

Alexs-Mac-mini:bookshare mehgcap$ python dbc.py
Traceback (most recent call last):
  File "dbc.py", line 1, in <module>
    import dialogs, globals, lbc
  File "/Volumes/BOOTCAMP/prog/bookshare/dialogs.py", line 1, in <module>
    import globals, lbc, pybookshare
  File "/Volumes/BOOTCAMP/prog/bookshare/globals.py", line 1, in <module>
    import configobj, lbc, os, sys, zipfile
  File "/Volumes/BOOTCAMP/prog/bookshare/lbc.py", line 11, in <module>
    import wx
  File "/usr/local/lib/wxPython-unicode-2.8.12.1/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.12.1/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.12.1/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.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core_.so: no matching architecture in universal wrapper
Alexs-Mac-mini:bookshare mehgcap$ 

If anyone can tell me what is going on and how to fix this, I would really appreciate it. This is Lion, 10.7.1, with Python 2.7 and wxPython 2.8.
Have a great day,
Alex (msg sent from Mac Mini)

Kevin Ollivier

unread,
Oct 3, 2011, 12:07:38 PM10/3/11
to wxpytho...@googlegroups.com
Hi Alex,

Are you using a 32-bit Python or have you set it to prefer / load 32-bit extensions? Otherwise, you'll run into a problem because wxPython 2.8 is 32-bit only.

Regards,

Kevin

Have a great day,
Alex (msg sent from Mac Mini)


Alex Hall

unread,
Oct 3, 2011, 12:15:27 PM10/3/11
to wxpytho...@googlegroups.com
I could be wrong, but I think there was only one installer for mac.
How do I set it to 32-bit mode? I found a forum post talking about
writing a preference, but the mac says that the command is not found.


--
Have a great day,
Alex (msg sent from GMail website)
meh...@gmail.com; http://www.facebook.com/mehgcap

Kevin Ollivier

unread,
Oct 3, 2011, 12:41:35 PM10/3/11
to wxpytho...@googlegroups.com
Hi Alex,

There are two installers on python.org for Mac, if that is where you got it from.

Thanks,

Kevin

Alex Hall

unread,
Oct 3, 2011, 12:47:55 PM10/3/11
to wxpytho...@googlegroups.com
Alright, I'll uninstall this one and make sure I find the 32-bit
installer then. Thanks.

Robin Dunn

unread,
Oct 3, 2011, 1:44:47 PM10/3/11
to wxpytho...@googlegroups.com
On 10/3/11 9:47 AM, Alex Hall wrote:
> Alright, I'll uninstall this one and make sure I find the 32-bit
> installer then. Thanks.

If you want or need to keep the 64-bit version of Python for some reason
then starting with 2.7 it includes a "python-32" command that you can
run instead of "python" that will force it to run in 32-bit mode.

--
Robin Dunn
Software Craftsman
http://wxPython.org

Alex Hall

unread,
Oct 3, 2011, 2:04:51 PM10/3/11
to wxpytho...@googlegroups.com
I don't really need 64 bit, but is there a way to always use 32-bit
mode so I don't have to re-install python and all my third-party
packages? By the way, sorry for top-posting, this website (gMail
mobile) won't let me do an in-line reply.

Robin Dunn

unread,
Oct 4, 2011, 2:25:23 PM10/4/11
to wxpytho...@googlegroups.com
On 10/3/11 11:04 AM, Alex Hall wrote:
> I don't really need 64 bit, but is there a way to always use 32-bit
> mode so I don't have to re-install python and all my third-party
> packages?

If you have a python-32 binary then you can use that. Otherwise I'm not
sure if the old environment variable or system preferences tricks still
work with 2.7 and/or on Lion...

Alex Hall

unread,
Oct 4, 2011, 2:33:25 PM10/4/11
to wxpytho...@googlegroups.com
That's okay, I just installed 32 bit. I thought there was only one
because the site has a file for 10.6+ and one for up to 10.6, and the
10.6+ file says 36-64 bit so I thought it would be fine. I now have to
older one and my app runs... well, it runs, but with delays of a
minute or so and much locking up, but that's another thread.

Reply all
Reply to author
Forward
0 new messages