I have written a (GUI) Python script which requires one external file and one module (in a folder). In order to package this script for distribution to others, I am using the following application file structure:
└── Contents
├── Info.plist
└── MacOS
├── colors.py
├── MainScript.py
└── <module>
├── <module files>
Info.plist looks like this:
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>MainScript.py</string>
</dict>
</plist>
MainScript.py begins with #!/usr/bin/env python3
and was made executable with chmod +x
.
When I double click the .app, it momentarily appears in the dock then vanishes. The strange part is that open MyApp.app
does work correctly when in the enclosing folder (as well as ./MainScript.py when in the MacOS folder). What am I doing wrong?