Re: [wxPython-users] wxpython on osx

292 views
Skip to first unread message

Robin Dunn

unread,
Aug 8, 2012, 1:44:41 PM8/8/12
to wxpytho...@googlegroups.com
On 8/7/12 5:34 PM, Kim wrote:
> Hi,
>
> Trying to get wxpython working on osx 10.7.4
>
> Demo's work fine when launched from the icon, but if I make a script in
> gedit and doubleclick, it just opens in gedit.

Because .py files are considered documents by default, so opening them
causes the system to open the associated application and feed the
document to it. There are ways around that, but my preference is to
just use the command line while in development, and then when it's ready
to deploy you can create a real application bundle for it using py2app.

>
> If I run from terminal I get this:
>
> arch -i386 /usr/bin/python wx1.py
>
> Traceback (most recent call last):
> File "wx1.py", line 5, 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:
> /usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core_.so:
> no appropriate 64-bit architecture (see "man python" for running in
> 32-bit mode)
>
> Please help. Sorry for noobness.

Did you try the things shown in the python man page (run "man python")
for forcing it to run in 32-bit mode? I thought they were still
supposed to work for Apple's Python.

OTOH, you will probably have better luck with the Python from python.org
instead of Apple's python in /usr/bin. The python.org version will
install in a different location so it won't stomp on Apple's Python, and
they also provide a "python-32" command that will force it to run the
32-bit architecture.

Finally, a good alternative would be to install the 2.9.4.0 cocoa port
of wxPython instead of the 2.8.12.1 carbon port. The cocoa port is able
to include the 64-bit architecture in the binaries and so you don't have
to mess with trying to force it to run only in 32-bit.

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

Kim

unread,
Aug 9, 2012, 5:20:31 AM8/9/12
to wxpytho...@googlegroups.com
Thanks for the info, worked perfectly

Wolfgang Keller

unread,
Aug 12, 2012, 3:08:16 PM8/12/12
to wxpytho...@googlegroups.com
> Finally, a good alternative would be to install the 2.9.4.0 cocoa
> port of wxPython instead of the 2.8.12.1 carbon port. The cocoa port
> is able to include the 64-bit architecture in the binaries and so you
> don't have to mess with trying to force it to run only in 32-bit.

How usable is wxPython 2.9.x already?

TIA,

Sincerely,

Wolfgang

Robin Dunn

unread,
Aug 13, 2012, 2:47:48 AM8/13/12
to wxpytho...@googlegroups.com
Very. Don't let the "development" or "unstable" tags scare you away.
It is much more capable and probably less buggy than 2.8.12. "Unstable"
in this case only means that some incompatible changes are allowed to
happen, but in practice it doesn't happen very often.
Reply all
Reply to author
Forward
0 new messages