MacOS .app bundle won't open

9 views
Skip to first unread message

Zoe Cheimets

unread,
Sep 24, 2025, 5:14:48 PM (16 hours ago) Sep 24
to PyInstaller
Hi, 

I am a new PyInstaller user trying to create a signed and notarized textual app for distribution outside of the App Store. I'm able to create a working executable for Windows and Linux, but having trouble with the .app bundle aspect of MacOS. 

The executable itself works on my Mac, even running MyApp.app/Contents/MacOS/myexecutable works after compiling the bundle with PyInstaller. However, double clicking on MyApp, or running `open MyApp.app` in the terminal results in my app timing out and/or crashing. This is the same behavior whether I sign and notarize or not. 

I use my own .spec file and entitlements file. The entitlements file only sets com.apple.security.cs.allow-jit and com.apple.security.cs.allow-unsigned-executable-memory to true. 

The Console logs have not been very helpful. Here are a few that I think are of note:
  1. failed to fetch **.app/Contents/_CodeSignature/CodeRequirements-1 error=-10

  2. found no value for key NSDoubleLocalizedStrings in CFPrefsSearchListSource<0x114f0a160> (Domain: com.**.**, Container: (null))

  3. Launch Services encountered an error, converting to OSStatus -43: Error Domain=NSCocoaErrorDomain Code=260 "The file “Library” couldn’t be opened because there is no such file." UserInfo={NSURL=Library/ -- file:/**app/Contents/, NSFilePath=**.app/Contents/Library, NSUnderlyingError=0x9d417ea30 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

I replaced any private information with **! 

Grateful for any help! Thanks!

Zoe Cheimets

unread,
Sep 24, 2025, 5:19:19 PM (16 hours ago) Sep 24
to PyInstaller

My spec file:

a = Analysis(
['switch_cc_tool.py'],
pathex=[],
binaries=[],
datas=[('*data*', '**'),
('**', '**data**')],
hiddenimports=['textual.widgets._tab_pane','yaml','lxml','jinja2'],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=['pkg_resources'],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)

exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='myapp',
debug=True,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
app = BUNDLE(
exe,
name='myApp.app',
icon=None,
bundle_identifier = 'com.mycompany.myapp',
info_plist = {
'CFBundleIdentifier' : 'com.mycompany.myapp',
'CFBundleDisplayName' : 'MyApp',
'CFBundleName' : 'MyApp',
'CFBundleExecutable' : 'my_app',
'CFBundlePackageType' : 'APPL',
'LSBackgroundOnly' : False
}
)
Reply all
Reply to author
Forward
0 new messages