PyInstaller OS X app runs from command line, but not Finder window

JoshG

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.

Paul R

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

OSX app built with python quits immediately if app bundle is executed from finder but runs fine from command line

From Dev

How to create a screen capture a specific OS X window from the command line?

From Dev

How to preview file contents from command line, instead of Finder.app

From Dev

Running command line app in the background using launchagents mac os x

From Dev

Script works from command line but not from a command in Application Finder Launcher

From Dev

Load x-window from command line in Debian

From Dev

How to restart X Window Server from command line?

From Dev

SSH stops working if command runs from local (logging in from OS X )

From Java

How to open Atom editor from command line in OS X?

From Dev

How to edit a file from the command line Mac OS X?

From Dev

Finding all not responding tasks from the command line in Mac OS X?

From Dev

Incorrect ctags called from OS X command line

From Dev

Can Dropbox under OS X be accessed from a command line?

From Dev

Execute "Get Info" on a file from command line in Mac OS X

From Dev

How to add user to a group from Mac OS X command line?

From Dev

mac os x app bundle built from pyinstaller doesn't work correctly

From Dev

Script runs from R, but not via command line

From Dev

applescript script runs from command line, but not when saved to app and double clicked

From Dev

is it possible to open a folder in Finder in the *current* space from the command line?

From Dev

is it possible to open a folder in Finder in the *current* space from the command line?

From Dev

Opening a new terminal from the command line and running a command on Mac OS X?

From Dev

OS X Finder Sync Extension

From Dev

How can I attach Instruments.app to a command line program on OS X?

From Dev

How can I bundle a command line utility in os x application on Mac App Store (using sandbox entitlement)

From Dev

Application crashes from command line but runs fine from Unity

From Dev

Show hidden window in OS X Swift app

From Dev

Mac OS X architecture and command line

From Dev

OS X app runs slowly when launched outside of XCode

From Dev

Wacom intuos issue. Clicking on a App in OS X Dock shows app in finder instead

Related Related

  1. 1

    OSX app built with python quits immediately if app bundle is executed from finder but runs fine from command line

  2. 2

    How to create a screen capture a specific OS X window from the command line?

  3. 3

    How to preview file contents from command line, instead of Finder.app

  4. 4

    Running command line app in the background using launchagents mac os x

  5. 5

    Script works from command line but not from a command in Application Finder Launcher

  6. 6

    Load x-window from command line in Debian

  7. 7

    How to restart X Window Server from command line?

  8. 8

    SSH stops working if command runs from local (logging in from OS X )

  9. 9

    How to open Atom editor from command line in OS X?

  10. 10

    How to edit a file from the command line Mac OS X?

  11. 11

    Finding all not responding tasks from the command line in Mac OS X?

  12. 12

    Incorrect ctags called from OS X command line

  13. 13

    Can Dropbox under OS X be accessed from a command line?

  14. 14

    Execute "Get Info" on a file from command line in Mac OS X

  15. 15

    How to add user to a group from Mac OS X command line?

  16. 16

    mac os x app bundle built from pyinstaller doesn't work correctly

  17. 17

    Script runs from R, but not via command line

  18. 18

    applescript script runs from command line, but not when saved to app and double clicked

  19. 19

    is it possible to open a folder in Finder in the *current* space from the command line?

  20. 20

    is it possible to open a folder in Finder in the *current* space from the command line?

  21. 21

    Opening a new terminal from the command line and running a command on Mac OS X?

  22. 22

    OS X Finder Sync Extension

  23. 23

    How can I attach Instruments.app to a command line program on OS X?

  24. 24

    How can I bundle a command line utility in os x application on Mac App Store (using sandbox entitlement)

  25. 25

    Application crashes from command line but runs fine from Unity

  26. 26

    Show hidden window in OS X Swift app

  27. 27

    Mac OS X architecture and command line

  28. 28

    OS X app runs slowly when launched outside of XCode

  29. 29

    Wacom intuos issue. Clicking on a App in OS X Dock shows app in finder instead

HotTag

Archive