Created Mac app works at terminal but not won't launch upon double-click

1,044 views
Skip to first unread message

Paul Fishback

unread,
Jun 23, 2021, 3:31:10 PM6/23/21
to PyInstaller
Running Mac Big Sur with Python 3.9 and the most recent pyinstaller.

My app, whose GUI utilizes tkinter, works fine at the terminal. However, when I double-click on the app, the icon briefly appears on the computer dock before disappearing.

Below is my spec file.

Thanks.

Paul

*************************************

block_cipher = None

a = Analysis(['Sample_Application.py'],
             pathex=['/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages', '/Users/fishbacp/Desktop'],
             binaries=[],
             datas=[('/Users/fishbacp/Desktop//background.png','.')],
             hiddenimports=['_tkinter','PIL'],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher,
             noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          [],
          exclude_binaries=True,
          name='Sample_Application',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
          console=False )
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=False,
               upx=True,
               upx_exclude=[],
               name='Sample_Application')
#exe
app = BUNDLE(coll,name='Sample_Application.app',icon='/Users/fishbacp/Desktop/spectrum.ico',bundle_identifier=None,
info_plist={
        'LSEnvironment': {
            'LANG': 'de_DE.UTF-8',
            'LC_CTYPE': 'de_DE.UTF-8'
        }})

Tepper

unread,
Jun 24, 2021, 9:35:21 AM6/24/21
to pyins...@googlegroups.com
Hi Paul,

I’ve been dealing with the same issue for a long time now, still without
a solution. It seems as if there are not many Mac users on this forum,
or Mac users that make use of PyInstaller, which truly puzzles me.

Anyways, if you happen to come across a solution I’d be grateful if
you could share it, and vice versa.

Cheers

Thor

____________________________
Dr. Thor Tepper García
Astrophysicist
www.thorsten.mx
@thorsten_mx

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/d86d5fc1-60f5-4608-a3a5-b31da9c2ffd1n%40googlegroups.com.

Steve Barnes

unread,
Jun 24, 2021, 10:44:55 AM6/24/21
to pyins...@googlegroups.com

Thor,

 

I am not a Mac user so can be of very little help but I recall there being reports of issues with running locally bundled applications due to the fact that the application was not signed by Macintosh App Store. I think that it might depend on one of the installation path &/or the launch method. Possibly some googling on these lines could help.

 

Steve Barnes

Israel Brewster

unread,
Jun 24, 2021, 1:11:31 PM6/24/21
to pyins...@googlegroups.com
I want to say I’ve run into this before, but it was simply an issue of what directory I was in when running the app from the terminal. That is, it worked when I ran it in the terminal *because* of the directory I was in when I ran it - when I changed to a different directory, such as the one the application was actually in, I got errors that I was then able to fix. It’s been a while since I dealt with it, however, and it was definitely pre Big Sur, so I can’t say for sure. I’ll have to check things on Big Sur.

---
Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320

Tepper

unread,
Jun 25, 2021, 8:04:49 AM6/25/21
to pyins...@googlegroups.com
Hi Steve,

Thanks a lot for your email.

I cannot reproduce the behaviour you mention.

Either way, I’ve goole myself nearly to death looking for a
solution to this issue since I first noticed it (~2019). And again,
the ‘problem’ seems to be the apparently low number of Mac + PyInsaller
users.

By the way, issues with an app’s Dock icon, have been present since
previous PyInstaller versions. For example, there was a time where two
icons would appear on the Dock, then none would appear; now one appears
briefly and disappears.

However, and although it is not ideal, this ‘issue’ does not hinder
an app in any way, at least in my case. Still, it would be great
if at some point we (somebody) could get to the bottom of it.

I only use my apps for research purposes, so it does not bother
me much, but I can imagine somebody packaging their app for
commercial purposes may want this issue to be solved at some point,
(and should also try to help to do so, needless to say).

Cheers

____________________________
Dr. Thor Tepper García
Astrophysicist
www.thorsten.mx
@thorsten_mx

Paul Fishback

unread,
Jun 25, 2021, 8:04:54 AM6/25/21
to pyins...@googlegroups.com
I was able to find the source of the problem. My application began with a "greeting" consisting of an image embedded on a figure canvas. In my spec file I had included the path to the image in datas. 

However, when double-clicking on the application, it appears that such information alone is not sufficient to ensure the bundled application can find the image at launch. A minor adjustment can be made, which is outlined by @ArmindoFlores and can be found at 


With regard to Steve's comment, my understanding is that Apple notarization will be required if I want anyone with Catalina or newer to be able to use it.

Thanks all for your responses.

Paul

You received this message because you are subscribed to a topic in the Google Groups "PyInstaller" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyinstaller/2L0IcUzRyW8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyinstaller...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/443326B5-AFB9-49B8-A3E9-BF5688978803%40alaska.edu.
Reply all
Reply to author
Forward
0 new messages