不起作用 由 PyInstaller 编译的 Kivy 应用程序



myApp.py是可行的。编译EXE后,发生错误。Kivy:V1.10.1Python:v3.6.5

简单的myapp.py可以在没有编译的情况下运行良好。它仅包含一个按钮。

myApp.spec:

# -*- mode: python -*-
from kivy.deps import sdl2, glew
block_cipher = None

a = Analysis(['myapp.py'],
             pathex=['C:\Users\Username\Desktop\test'],
             binaries=[],
             datas=[],
             hiddenimports=[],
             hookspath=[],
             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,
          a.scripts,
          [],
          exclude_binaries=True,
          name='myapp',
          debug=False,
          bootloader_ignore_signals=False,
          strip=False,
          upx=True,
          console=True )
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)],
               strip=False,
               upx=True,
               name='myapp')

控制台:

[CRITICAL] Text: Unable to find any valuable Text provider.
sdl2 - ImportError: DLL load failed: Не найдена указанная процедура.
  File "D:Pythonlibsite-packageskivycore__init__.py", line 59, in core_select_lib
    fromlist=[modulename], level=0)
  File "D:Pythonlibsite-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "D:Pythonlibsite-packageskivycoretexttext_sdl2.py", line 12, in <module>
    from kivy.core.text._text_sdl2 import (_SurfaceContainer, _get_extents,
pil - ModuleNotFoundError: No module named 'PIL'
  File "D:Pythonlibsite-packageskivycore__init__.py", line 59, in core_select_lib
    fromlist=[modulename], level=0)
  File "D:Pythonlibsite-packagesPyInstallerloaderpyimod03_importers.py", line 627, in exec_module
    exec(bytecode, module.__dict__)
  File "D:Pythonlibsite-packageskivycoretexttext_pil.py", line 7, in <module>
    from PIL import Image, ImageFont, ImageDraw
[CRITICAL] App: Unable to get a Text provider, abort.

是什么问题,我需要做什么?预先感谢。

python -m pip install opencv-contrib-python-headless
python -m pip install pyenchant
python -m pip install cython
python -m pip install Pillow

相关内容

最新更新