I am using buildout to create a local python environment, and then using the local python to create my app with py2app
. But, when I go into the .app file, specifically into Contents/MacOS/, there is just a shortcut to the system python. I want py2app
to somehow take the local python with it so that it only depends on itself, not on the system python.
So my question is: How can I fix this so that py2app will bundle my custom local version of python2.7 so that my app will be totally standalone, regardless of the local python version?
Please let me know if more information would be helpful.
My setup.py
from setuptools import setup
APP = ['main.py']
DATA_FILES = ['src/icon.xib']
OPTIONS = {
'argv_emulation': True,
'packages': [ 'requests' ],
'iconfile':'src/myApp.icns',
'plist': {'CFBundleShortVersionString':'0.1.0',
'LSUIElement': True
}
}
setup(
name='myApp',
package_dir = {'':'src'},
app=APP,
data_files=DATA_FILES,
options={'py2app': OPTIONS},
setup_requires=['py2app'],
)
Py2app will not include system files, such as the python installation in /System/Library/Frameworks, in your application bundle.
To create a bundle that also includes Python you need to install a separate version of Python (and all libraries that you use).
However, note that the app created with the system version of Python should work properly on machines with the same release of OSX, or a later release.