Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python “;无法获取窗口,中止”;运行kivy应用程序_Python_Python 3.x_Pycharm_Kivy - Fatal编程技术网

Python “;无法获取窗口,中止”;运行kivy应用程序

Python “;无法获取窗口,中止”;运行kivy应用程序,python,python-3.x,pycharm,kivy,Python,Python 3.x,Pycharm,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 p

我刚从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()

有什么想法吗?

它对我有用(win10 64位,Anaconda)。您使用的是哪个OS\Python版本?Python 3.8,windows 10什么是Anaconda?Anaconda是一个Python发行版,包含许多库和Spyder IDE:我在没有Anaconda的情况下运行了您的代码,它仍然可以工作。请查看此页面以了解可能的解决方案: