I reverted to `5.12.0` and the can now be built in a working way
On Tuesday, August 15, 2023 at 4:59:01 AM UTC-4 Ankur Toshniwal wrote:
> It seems as though in a recent set of fixes, PyInstaller is attempting to
> structure macOS `.app` bundles correctly. (Code bundles are placed in
> Resources and Frameworks instead of MacOS). The bundle looks good, it has
> only the main executable in MacOS now as macOS bundles should. However...
>
> It seems it broke everything because all the needed libs are now no longer
> in the same relative path as they used to be:
>
> [17452] Error loading Python lib
> '/Users/ankurtoshniwal/pwr/thoughts/desktop_app/build/0.6.0a1/Project White
> Rabbit.app/Contents/MacOS/Python': dlopen:
> dlopen(/Users/ankurtoshniwal/pwr/thoughts/desktop_app/build/0.6.0a1/Project
> White Rabbit.app/Contents/MacOS/Python, 0x000A): tried:
> '/Users/ankurtoshniwal/pwr/thoughts/desktop_app/build/0.6.0a1/Project White
> Rabbit.app/Contents/MacOS/Python' (no such file),
> '/System/Volumes/Preboot/Cryptexes/OS/Users/ankurtoshniwal/pwr/thoughts/desktop_app/build/0.6.0a1/Project
>
> White Rabbit.app/Contents/MacOS/Python' (no such file),
> '/Users/ankurtoshniwal/pwr/thoughts/desktop_app/build/0.6.0a1/Project White
> Rabbit.app/Contents/MacOS/Python' (no such file)
>
>
> Saving session...completed.
>
>
> [Process completed]
>
> My spec file is:
>
> ```
>
> # -*- mode: python ; coding: utf-8 -*-
> import inspect
> import os
> import sys ; sys.setrecursionlimit(sys.getrecursionlimit() * 5)
>
> import PySide6
> import _pyinstaller_hooks_contrib
>
> # Allow us to import from `core`
> sys.path.append(".")
>
> from core import __app_name__, __version__
>
> block_cipher = None
>
> community_hooks_path =
> os.path.dirname(inspect.getfile(_pyinstaller_hooks_contrib))
>
> pyside6_path = os.path.dirname(inspect.getfile(PySide6))
>
> a = Analysis(
> ['./ProjectWhiteRabbit.py'],
> pathex=[os.path.abspath(".")],
> datas=[
> ("./*.traineddata", "."),
> ("./gui/img", "./gui/img"),
> ("./gui/fonts", "./gui/fonts"),
> ("./alembic.ini", "."),
> ("./migrations", "./migrations"),
> ("./scripts", "./scripts"),
> ],
> hiddenimports=[
> "sqlalchemy.sql.default_comparator",
>
> "sklearn.metrics._pairwise_distances_reduction._middle_term_computer",
> "sklearn.metrics._pairwise_distances_reduction._datasets_pair",
> "tiktoken_ext",
> "tiktoken_ext.openai_public",
> ],
> hookspath=[
> os.path.join(community_hooks_path, "hooks/stdhooks")
> ],
> runtime_hooks=[],
> 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=__app_name__,
> debug=False,
> bootloader_ignore_signals=False,
> strip=False,
> upx=True,
> target_arch='x86_64',
> console=False
> )
>
> coll = COLLECT(
> exe,
> a.binaries,
> a.zipfiles,
> a.datas,
> strip=False,
> upx=True,
> upx_exclude=[],
> name=__app_name__
> )
>
> app = BUNDLE(
> coll,
> name=f'{__app_name__}.app',
> icon='ProjectWhiteRabbit.icns',
> bundle_identifier='builders.pwr',
> info_plist={
> "NSPrincipalClass": "NSApplication",
> "NSAppleScriptEnabled": False,
> 'CFBundleName': __app_name__,
> 'CFBundleDisplayName': __app_name__,
> 'CFBundleVersion': __version__,
> 'CFBundleShortVersionString': __version__,
> 'CFBundleTypeIconFiles': ['ProjectWhiteRabbit.icns'],
> 'NSHighResolutionCapable': True,
> # This makes the app appearance match the current theme in Mac
> # rather than always being light theme
> "NSRequiresAquaSystemAppearance": True,
> "NSAppleEventsUsageDescription": "Access to apple events allows
> PWR to be accessible through system wide shortcuts."
> }
> )
>
> ```
>
> I'm not too sure how to proceed here, but I can share our `.spec` file as
> well.
>
> Anyone else facing this issue? Would appreciate a hand here! I can share
> more and discuss this if anyone is familiar. My company depends on it
> *grimmacing*
>
> Thanks in advance,
>
> Ankur
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyinstaller/b2f5e7c6-e03c-4079-9187-e9feb5c6b383n%40googlegroups.com.