繁体   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