首页 > 解决方案 > “无法获得窗口,中止”运行 kivy 应用程序

问题描述

我刚开始使用 kivy,我无法克服这个错误。我正在使用pycharm。

[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.
[CRITICAL] [App         ] Unable to get a Window, abort.

这是我的代码:

import kivy
from kivy.app import App
from kivy.uix.label import Label


class MyApp(App):
def build(self):
    return Label(text="Hello world!")


if __name__ == "__main__":
    MyApp().run()

有任何想法吗?

标签: pythonpython-3.xpycharmkivy

解决方案


推荐阅读