I have an app build in PySide6, build using pyinstaller into the MacOS application.
I’m experiencing strange problem when running the built application – sometimes the build if fine and the app starts without any problems. But then I change some not important lines of code, rebuild the app – and the build is broke. When I start the binary, I get the following message:
<pre>
PySide6/__init__.py: Unable to import Shiboken from /Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/base_library.zip, /Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/lib-dynload, /Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks
PySide6/__init__.py: Unable to import Shiboken from /Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/base_library.zip, /Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/lib-dynload, /Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks
Traceback (most recent call last):
File "main.py", line 9, in <module>
File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
File "gui.py", line 4, in <module>
File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
File "PySide6/__init__.py", line 124, in <module>
File "PySide6/__init__.py", line 64, in _setupQtDirectories
File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
File "shiboken6/__init__.py", line 27, in <module>
ImportError: dlopen(/Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/shiboken6/Shiboken.abi3.so, 0x0002): Symbol not found: __ZN8Shiboken14BindingManager14dumpWrapperMapEv
Referenced from: <B31AD3C0-E93A-3A53-BC28-ABA64B3F119C> /Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/shiboken6/Shiboken.abi3.so
Expected in: <3D177653-B9D2-3FF2-A8CB-A4BBADC6B7B6> /Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/libshiboken6.abi3.6.7.dylib
[51645] Failed to execute script 'main' due to unhandled exception: dlopen(/Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/shiboken6/Shiboken.abi3.so, 0x0002): Symbol not found: __ZN8Shiboken14BindingManager14dumpWrapperMapEv
Referenced from: <B31AD3C0-E93A-3A53-BC28-ABA64B3F119C> /Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/shiboken6/Shiboken.abi3.so
Expected in: <3D177653-B9D2-3FF2-A8CB-A4BBADC6B7B6> /Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/libshiboken6.abi3.6.7.dylib
[51645] Traceback:
Traceback (most recent call last):
File "main.py", line 9, in <module>
File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
File "gui.py", line 4, in <module>
File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
File "PySide6/__init__.py", line 124, in <module>
File "PySide6/__init__.py", line 64, in _setupQtDirectories
File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
File "shiboken6/__init__.py", line 27, in <module>
ImportError: dlopen(/Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/shiboken6/Shiboken.abi3.so, 0x0002): Symbol not found: __ZN8Shiboken14BindingManager14dumpWrapperMapEv
Referenced from: <B31AD3C0-E93A-3A53-BC28-ABA64B3F119C> /Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/shiboken6/Shiboken.abi3.so
Expected in: <3D177653-B9D2-3FF2-A8CB-A4BBADC6B7B6> /Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/libshiboken6.abi3.6.7.dylib
</pre>
Some additional information:
-
I’m using python 3.12.4, installed using pyenv, although the same issue occurred also on 3.10.6
-
I’m using a fresh venv, with only three packages installed: PySide6, pyinstaller, requests (without version specified == newest)
-
my spec file is:
# -*- mode: python ; coding: utf-8 -*- a = Analysis( ['src/main.py'], pathex=['src/'], binaries=[], datas=[ ('src/resources', 'resources') ], hiddenimports=['shiboken6'], hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], noarchive=False, optimize=0, ) pyz = PYZ(a.pure) exe = EXE( pyz, a.scripts, [], exclude_binaries=True, name='Family Rules', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, console=False, disable_windowed_traceback=False, argv_emulation=False, target_arch=None, codesign_identity=None, entitlements_file=None, ) coll = COLLECT( exe, a.binaries, a.datas, strip=False, upx=True, upx_exclude=[], name='Family Rules', ) app = BUNDLE( coll, name='Family Rules.app', icon='src/resources/icon.icns', bundle_identifier=None, info_plist={ 'LSUIElement': True, 'LSBackgroundOnly': False, 'NSUIElement': True } )