I'm using OS X Lion (10.7.3) and I'm trying to write a cross-platform, stand-alone GUI-based program using wxPython
and py2app
.
I tried to use Python 2.7.1 which comes shipped with Lion.
I got the wxPython2.8
binaries (wxPython2.8-osx-unicode-py2.7).
I installed py2app
via pip.
This is my little test app:
#!/usr/bin/python
import wx
app = wx.App()
frame = wx.Frame(None, -1, 'test.py')
frame.Show()
app.MainLoop()
This is my setup.py
:
from setuptools import setup
setup(
app=["test.py"],
setup_requires=["py2app"],
)
wxPython 2.8 wants 32-bit mode, so I use the arch
command:
arch -i386 /usr/bin/python2.7 test.py
How do I tell py2app to use/include 32bit Python?
It is possible to manually exchange the relevant files in the app bundle, but that's a rather clumsy workaround. I could also use 64bit wxPython2.9, but there isn't a stable release available yet. Should I switch to cx_Freeze
? What is the best practice here?