Zachciało mi się nauczyć Kivy, w związku z czym zainstalowałem na komputerze (Windows 10) Kivy, zgodnie z zaleceniami z sieci. zrobiłem sobie venv zgodnie z zaleceniami i zainstalowane mam:
> pip list
Package Version
------------------- ---------
certifi 2019.9.11
chardet 3.0.4
Cython 0.29.14
docutils 0.15.2
idna 2.8
Kivy 1.11.1
kivy-deps.angle 0.1.9
kivy-deps.glew 0.1.12
kivy-deps.gstreamer 0.1.17
kivy-deps.sdl2 0.1.22
Kivy-Garden 0.1.4
Naked 0.1.31
Pillow 6.2.1
pip 19.3.1
pycryptodome 3.9.0
Pygments 2.4.2
pypiwin32 223
pywin32 225
PyYAML 5.1.2
requests 2.22.0
setuptools 41.6.0
shellescape 3.4.1
urllib3 1.25.6
wheel 0.33.6
Program, który chcę odpalić jest mega prosty:
from kivy.app import App
from kivy.uix.label import Label
class FirstKivy(App):
"""First app"""
def build(self):
return kivy.uix.label.Label(text="Hello Kivy!")
FirstKivy().run()
Niestety, przy próbie uruchomienia otrzymuję:
[INFO ] [Logger ] Record log in C:\Users\Nikodem\.kivy\logs\kivy_19-11-03_25.txt
[INFO ] [deps ] Successfully imported "kivy_deps.gstreamer" 0.1.17
[INFO ] [deps ] Successfully imported "kivy_deps.sdl2_dev" 0.1.22
[INFO ] [deps ] Successfully imported "kivy_deps.angle" 0.1.9
[INFO ] [deps ] Successfully imported "kivy_deps.glew" 0.1.12
[INFO ] [deps ] Successfully imported "kivy_deps.sdl2" 0.1.22
[INFO ] [Kivy ] v1.11.1
[INFO ] [Kivy ] Installed at "C:\Users\Nikodem\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\kivy\__init__.py"
[INFO ] [Python ] v3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 15 2019, 01:31:54) [MSC v.1916 64 bit (AMD64)]
[INFO ] [Python ] Interpreter at "C:\Users\Nikodem\Documents\Kivy_test\test2\venv\Scripts\python.exe"
[INFO ] [Factory ] 184 symbols loaded
[DEBUG ] [Cache ] register <kv.lang> with limit=None, timeout=None
[DEBUG ] [Cache ] register <kv.image> with limit=None, timeout=60
[DEBUG ] [Cache ] register <kv.atlas> with limit=None, timeout=None
[DEBUG ] [image ] Failed trying to import the "sdl2" provider from "C:\Users\Nikodem\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\kivy\core\image\_img_sdl2.cp37-win_amd64.pyd". This error is often encountered when a dependency is missing, or if there are multiple copies of the same dependency dll on the Windows PATH and they are incompatible with each other. This can occur if you are mixing installations (such as different python installations, like anaconda python and a system python) or if another unrelated program added its directory to the PATH. Please examine your PATH and python installation for potential issues. To further troubleshoot a "DLL load failed" error, please download "Dependency Walker" (64 or 32 bit version - matching your python bitness) from dependencywalker.com and set the environment variable KIVY_SDL2_DEPENDENCY_WALKER to the full path of the downloaded depends.exe file and rerun your application to generate an error report
[INFO ] [Image ] Providers: img_tex, img_dds, img_pil, img_gif (img_sdl2, img_ffpyplayer ignored)
[DEBUG ] [Cache ] register <kv.texture> with limit=1000, timeout=60
[DEBUG ] [Cache ] register <kv.shader> with limit=1000, timeout=3600
[DEBUG ] [Text ] Provider <sdl2> ignored by config
[INFO ] [Text ] Provider: pil(['text_sdl2'] ignored)
[DEBUG ] [App ] Loading kv <.\firstkivy.kv>
[DEBUG ] [App ] kv <.\firstkivy.kv> not found
[DEBUG ] [window ] Failed trying to import the "sdl2" provider from "C:\Users\Nikodem\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\kivy\core\window\_window_sdl2.cp37-win_amd64.pyd". This error is often encountered when a dependency is missing, or if there are multiple copies of the same dependency dll on the Windows PATH and they are incompatible with each other. This can occur if you are mixing installations (such as different python installations, like anaconda python and a system python) or if another unrelated program added its directory to the PATH. Please examine your PATH and python installation for potential issues. To further troubleshoot a "DLL load failed" error, please download "Dependency Walker" (64 or 32 bit version - matching your python bitness) from dependencywalker.com and set the environment variable KIVY_SDL2_DEPENDENCY_WALKER to the full path of the downloaded depends.exe file and rerun your application to generate an error report
[DEBUG ] [Window ] Ignored <sdl2> (import error)
[CRITICAL] [Window ] Unable to find any valuable Window provider. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
sdl2 - ImportError: DLL load failed: %1 nie jest prawidłową aplikacją systemu Win32.
File "C:\Users\Nikodem\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\kivy\core\__init__.py", line 63, in core_select_lib
fromlist=[modulename], level=0)
File "C:\Users\Nikodem\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\kivy\core\window\window_sdl2.py", line 27, in <module>
from kivy.core.window._window_sdl2 import _WindowSDL2Storage
[CRITICAL] [App ] Unable to get a Window, abort.