Mac Big Sur, python 3.9, pyinstaller 4.3.
I've seen this question posted elsewhere, e.g. PyInstaller OS X app runs from command line, but not Finder window, but can't quite understand the proposed solutions. I have a Mac .app created using tkinter and pyinstaller that functions fine at the terminal when I type
./dist/MyApplication.app/Contents/MacOS/MyApplication
However, when I double click on the .app in the Finder, the program icon appears briefly on my computer's dock before disappearing. No error message at all.
Here is my .spec file:
block_cipher = None
a = Analysis(['MyApplication.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='MyApplication',
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='MyApplication')
app =
BUNDLE(coll,name='MyApplication.app',
icon='/Users/fishbacp/Desktop/spectrum.ico',
bundle_identifier=None,
info_plist={'LSEnvironment': {'LANG': 'de_DE.UTF-8',
'LC_CTYPE': 'de_DE.UTF-8'}})