I am using Python 3 from the Anaconda distribution, and trying to convert a simple python program into an OS X app (running on El Capitan). Following the instructions in the tutorial, I ran
py2applet --make-setup my-script.py
python setup.py py2app -A
Everything ran fine with no errors, but when I try to launch the app, I get this error message:
my-script: A python runtime not could (sic) be located. You may need to install a framework build of Python, or edit the PyRuntimeLocations array in this applications Info.plist file.
I understood this to mean I should add the path of Anaconda's python (which is in my bash PATH, but is not known to the launcher). However, the app's automatically generated Info.plist
already points to the Anaconda python binary:
<key>PythonInfoDict</key>
<dict>
<key>PythonExecutable</key>
<string>/Applications/Experimental/anaconda/bin/python</string>
...
I don't see what there is to fix here. I have read these related questions:
- How do I use py2app with a virtual environment?
- py2app is not copying the python framework to the new app while using virutalenv
The first question involves the same error message, and is resolved by following the advice in the second question. But as I understand it, these questions describe the opposite situation: The OP was running a python distributed with the OS, and wanted to distribute their app; the solution is to use a separately installed python. I am using a non-system python, and I'm not yet trying to distribute anything. So what is causing the trouble here, and what is the solution?
python setup.py py2app
), or byopen -a dist/MyApplication.app
? – Alwinopen -a dist/my-script.app
fails ("Unable to find application named 'dist/my-open.app'"), but trying a full app build (still doesn't work but) flushed out the problem: Thelibpython
dll is not named as py2app expects. I was able to fix it by editing the generatedInfo.plist
. – Lockard