I have an application bundle created with PyInstaller on OS X. If I double click the .app bundle in Finder, the application tries to launch, then terminates. No further information is given in the console, other than the application quit.
But if I launch the app executable from the terminal (i.e., ./Contents/MacOS/MyApplication
, it works perfectly fine. This seems to be the same behavior experienced in this issue: OSX app built with python quits immediately if app bundle is executed from finder but runs fine from command line, but the marked solution there isn't particularly helpful.
I suspect this is indeed related to an environment or path issue. But I'm not sure how to fix it. Should something be specified in the info.plist
file maybe? Any guidance would be greatly appreciated.
This is most likely due to a bad assumption about the working directory. When you launch from the Finder, the working directory may well be /
(depends on OS X version), which is not writeable. If your app writes to the current working directory then you should probably set the working directory to somewhere sensible at startup.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With