简体   繁体   中英

Kivy app crash on MacOs after compiling with Pyinstaller

Here is my problem: I have a Kivy app. It runs perfectly with python but when I compile it with Pyinstaller to.dmg the app crash at launch... I don't know why. (Compiling with pyinstaller on windows works).

Here's my.spec:

# -*- mode: python ; coding: utf-8 -*-


block_cipher = None


a = Analysis(
    ['main.py'],
    pathex=[],
    binaries=[],
    datas=[
        ('myKivy.kv','.'),
        ('CertifitechModules/','CertifitechModules'),
        ('ressources/','ressources')
        ],
    hiddenimports=[],
    hookspath=[],
    hooksconfig={},
    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,
    Tree('/Users/simon/Downloads/Certifitech/'),
    a.scripts,
    [],
    exclude_binaries=True,
    name='Certifitech',
    debug=True,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    console=True,
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
)
coll = COLLECT(
    exe,
    Tree('/Users/simon/Downloads/Certifitech/'),
    a.binaries,
    a.zipfiles,
    a.datas,
    strip=False,
    upx=True,
    upx_exclude=[],
    name='Certifitech',
)
app = BUNDLE(
    coll,
    name='Certifitech.app',
    icon="icon.ico",
    bundle_identifier=None,
)

To compile it I use the kivy and home-brew tutorial: pyinstaller -y --clean main.spec

And for.dmg: hdiutil create./main.dmg -srcfolder main.app -ov

Any idea? Maybe at least a way to show a console with errors can help me because now, I have nothing at all !

Thanks !

I assume you to have external libraries used in the code, if that is true, you need to check the dist folder for all the folders that correspond to the libraries imported by you

for example, If you have face_recognition library imported in your app you need to check for two folders in your dist directory

  1. face recognition 2)face_recognition models

Pyinstaller sometimes dosent include certain libraries required by our code

You add them manually and the app will work Butter smooth.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM