PyInstaller OS X launches from command line but not Finder window

I have an application package built with PyInstaller on OS X. If I double click on the .app package in Finder, the application tries to start and then exits. No additional information is listed in the console besides the application.

But if I run the app from the terminal (i.e. ./Contents/MacOS/MyApplication

it works fine.when python exits, if the app bundle is executed with finder, but works fine from the command line, but the noticeable solution is not particularly useful there.

I suspect this is indeed related to an environment or path issue. But I'm not sure how to fix this. Should something be specified in the file info.plist

maybe? Any guidance would be greatly appreciated.


source to share

1 answer

This is most likely due to a bad assumption about the working directory. When launched from Finder, the working directory may be /

(depending on the OS X version) that cannot be written. If your application is writing to the current working directory, you should probably set the working directory somewhere reasonable at startup.



All Articles