Kivy - problem z uruchomieniem lub instalacją

0

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.
0

Masz wskazówkę w błędzie

[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
```

Możesz też popatrzeć na https://github.com/kivy/kivy/issues/6276
0
Spearhead napisał(a):

Masz wskazówkę w błędzie

[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
```

Możesz też popatrzeć na https://github.com/kivy/kivy/issues/6276

No właśnie nie do końca to rozumiem - mimo tego, że biblioteka *kivy-deps.sdl2 * jest zainstalowana Python nie może załadować - no właśnie czego, SDL2.dll? Jak ugryźć to debugowanie? Tym Walkerem właśnie?

0

No właśnie nie do końca to rozumiem - mimo tego, że biblioteka kivy-deps.sdl2 jest zainstalowana Python nie może załadować - no właśnie czego, SDL2.dll? Jak ugryźć to debugowanie? Tym Walkerem właśnie?

Na to wygląda, zawsze to więcej danych do debuggowania. Kivy z tego co kojarzę regularnie ma zgłaszane różne problemy z instalacją, czy to na Stacku czy w issuach githuba. Sporo postów ze Stacka radzi reinstalację, np tu, tu i tu

Osobiście używam Linuksa, ale jak kiedyś dłubałem przy tym na Winzgrozie to łatwiej mi było zainstalować bibliotekę z nieoficjalnych binarek.

0
Spearhead napisał(a):

No właśnie nie do końca to rozumiem - mimo tego, że biblioteka kivy-deps.sdl2 jest zainstalowana Python nie może załadować - no właśnie czego, SDL2.dll? Jak ugryźć to debugowanie? Tym Walkerem właśnie?

Na to wygląda, zawsze to więcej danych do debuggowania. Kivy z tego co kojarzę regularnie ma zgłaszane różne problemy z instalacją, czy to na Stacku czy w issuach githuba. Sporo postów ze Stacka radzi reinstalację, np tu, tu i tu

Osobiście używam Linuksa, ale jak kiedyś dłubałem przy tym na Winzgrozie to łatwiej mi było zainstalować bibliotekę z nieoficjalnych binarek.

No właśnie jestem przerażony popularnością problemów z tym frameworkiem pod różnymi systemami ;) normalnie siedzę pod Windowsem i z niczym nie miałem podobnych problemów, jak w ogóle z uruchomieniem przykładowego "hello world". Myślałem, że przejście do venv uniezależni mnie od tych problemów, ale niestety nie. Albo to jakoś ogarnę, albo poszuka jakieś alternatywy ;d

0

Po skorzystaniu z Dependency Walkera wychodzi na to, że brakuje mi ogromnej ilości DLLek typu API-MS-WIN-APPMODEL-IDENTITY-L1-2-0.DLL. Mimo doinstalowania polecanego Windows 10 SDK nic nie działa nadal.

0

Po skorzystaniu z Dependency Walkera wychodzi na to, że brakuje mi ogromnej ilości DLLek typu API-MS-WIN-APPMODEL-IDENTITY-L1-2-0.DLL.

Te możesz zignorować

Spróbuj jeszcze usunąć Kivy i kivy-deps-* (pip uninstall) i użyć Instalatora.

0
Spearhead napisał(a):

Po skorzystaniu z Dependency Walkera wychodzi na to, że brakuje mi ogromnej ilości DLLek typu API-MS-WIN-APPMODEL-IDENTITY-L1-2-0.DLL.

Te możesz zignorować

Spróbuj jeszcze usunąć Kivy i kivy-deps-* (pip uninstall) i użyć Instalatora.

Zrobiłem jeszcze inaczej - zainstalowałem Anacondę i do tego interpretera Pythona doinstalowałem (pipem, nie condą) potrzebne rzeczy i... działa.

Teraz za to mam problem z deployem tego na Androidzie (buduję aplikację Buildozerem na Raspbianie), ale to już osobny wątek.

0

@Nikodem Czechowski: Udało Ci się odpalić Kivy oraz Buildozer ?
Ja również mam z tym problem, męczę się od dłuższego czasu.

Robiłeś to według jakieś tutoriala ?

0

Czy może mi ktoś pomóc odpalić Kivy ?
Robię wszystko według tutoriala z youtube, ale mimo wszystko nie działa :(

Tutaj pełny logfile:

https://paste.ofcode.org/336FfGnjn2CJfAZz4axtg2N

1 użytkowników online, w tym zalogowanych: 0, gości: 1