I need to create a standalone python app with wxPython, to work with Mac OSX Lion (the client’s OS).
I only have access to a Mac with Snow Leopard, and used it to build the app with py2app. With Snow Leopard it works fine, and didn’t even have to install wxPython.
On a OSX Lion however, the wx import fails (no module found), even after installing the wxPython for python2.7 (Carbon). I can import wx from the terminal (using the default python – 2.7), but the app still fails to find wx on import.
I used the following setup.py:
from setuptools import setup
APP = ['main.py']
DATA_FILES = []
OPTIONS = {'arch': 'i386', 'argv_emulation': True}
setup(
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
And compiled it using arch -i386 /usr/bin/python2.6 setup.py py2app, to be able to run it on 32-bit.
What’s the best way to make it run on Lion, compiling on Snow Leopard? Could I include the wxPython with the app, or even python itself (in case it really needs to run with py2.6)? Can I order the application to run /usr/bin/python2.6?
Per the chat discussion, use the latest stable versions of Python and wxPython, and make sure the Python is the OS X 10.6 and 10.7 version. (And don’t try to build them from source.)