У меня возникла странная проблема при запуске встроенного приложения — иногда сборка проходит нормально, а приложение запускается без проблем.
Но потом меняю некоторые не важные строчки кода, пересобираю приложение - и сборка ломается.
Когда Выполняю бинарный файл, получаю следующее сообщение:
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
File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
File "gui.py", line 4, in
File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
File "PySide6/__init__.py", line 124, in
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
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: /Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/shiboken6/Shiboken.abi3.so
Expected in: /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: /Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/shiboken6/Shiboken.abi3.so
Expected in: /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
File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
File "gui.py", line 4, in
File "PyInstaller/loader/pyimod02_importers.py", line 419, in exec_module
File "PySide6/__init__.py", line 124, in
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
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: /Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/shiboken6/Shiboken.abi3.so
Expected in: /Users/rafal/Developer/family-rules-client/dist/Family Rules.app/Contents/Frameworks/libshiboken6.abi3.6.7.dylib
Некоторая дополнительная информация:
- Я использую Python 3.12.4, установленный с помощью pyenv, хотя проблема та же. произошло также в 3.10.6.
- Я использую новый venv, в котором установлены только три пакета: PySide6, pyinstaller, запросы (без указания версии == самый новый)
- Мой файл спецификации следующий:
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
}
)
Подробнее здесь: https://stackoverflow.com/questions/788 ... -not-found