Я пытаюсь следовать руководству по kivy, и тестовый код таков:
import kivy
from kivy.app import App
from kivy.uix.label import Label
class myApp(App):
def build(self):
return Label(text="Tech With Tim")
if __name__ == "__main__":
myApp().run()
Однако я получаю это в консоли:
[INFO ] [Logger ] Record log in C:\Users\ultra\.kivy\logs\kivy_20-04-26_1.txt
[INFO ] [deps ] Successfully imported "kivy_deps.gstreamer" 0.2.0
[INFO ] [deps ] Successfully imported "kivy_deps.angle" 0.2.0
[INFO ] [deps ] Successfully imported "kivy_deps.glew" 0.2.0
[INFO ] [deps ] Successfully imported "kivy_deps.sdl2" 0.2.0
[INFO ] [Kivy ] v2.0.0rc1, git-ae0fa0c, 20191229
[INFO ] [Kivy ] Installed at "C:\Users\ultra\AppData\Roaming\Python\Python38\site-packages\kivy\__init__.py"
[INFO ] [Python ] v3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)]
[INFO ] [Python ] Interpreter at "C:\Program Files (x86)\Python38-32\python.exe"
[INFO ] [Factory ] 184 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_pil, img_gif (img_sdl2, img_ffpyplayer ignored)
[INFO ] [Text ] Provider: pil(['text_sdl2'] ignored)
[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 while importing _window_sdl2: The specified module could not be found.
File "C:\Users\ultra\AppData\Roaming\Python\Python38\site-packages\kivy\core\__init__.py", line 58, in core_select_lib
mod = __import__(name='{2}.{0}.{1}'.format(
File "C:\Users\ultra\AppData\Roaming\Python\Python38\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.
1
Stack trace:
> File "C:\Users\ultra\Desktop\Python Scripts\The App\Kivy Tutorial\kivyAppTutorial.py\kivyAppTutorial.py\kivyAppTutorial.py.py", line 8, in build
> return Label(text="Tech With Tim")
> File "C:\Users\ultra\Desktop\Python Scripts\The App\Kivy Tutorial\kivyAppTutorial.py\kivyAppTutorial.py\kivyAppTutorial.py.py", line 13, in <module>
> myApp().run()
Loaded '__main__'
Loaded 'kivy.app'
Loaded 'runpy'
The program 'python.exe' has exited with code -1 (0xffffffff).
У меня есть понятия не имею, как это исправить. Некоторые похожие проблемы говорят о проблеме установки, но я точно следил за установкой, и решения тоже не работают. Любая помощь приветствуется.
Я запускаю python 3.8.1 на Windows 10. Это не удалось как в Visual Studio, так и при запуске файла .py через cmd.