簡體   English   中英

Kivy 使用 Pyinstaller 編譯后 MacO 上的應用程序崩潰

[英]Kivy app crash on MacOs after compiling with Pyinstaller

這是我的問題:我有一個 Kivy 應用程序。 它與 python 完美運行,但是當我使用 Pyinstaller to.dmg 編譯它時,應用程序在啟動時崩潰......我不知道為什么。 (在 windows 上使用 pyinstaller 進行編譯)。

這是我的規范:

# -*- 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,
)

要編譯它,我使用 kivy 和自制教程: pyinstaller -y --clean main.spec

對於.dmg: hdiutil create./main.dmg -srcfolder main.app -ov

任何的想法? 也許至少一種顯示錯誤控制台的方法可以幫助我,因為現在,我什么都沒有了!

謝謝 !

我假設您在代碼中使用了外部庫,如果是這樣,您需要檢查 dist 文件夾中與您導入的庫相對應的所有文件夾

例如,如果您的應用程序中導入了 face_recognition 庫,則需要檢查 dist 目錄中的兩個文件夾

  1. 人臉識別2)face_recognition模型

Pyinstaller 有時會包含我們代碼所需的某些庫

您手動添加它們,應用程序將運行 Butter 流暢。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM