本文介绍了Kivy 不工作(错误:无法找到任何有价值的窗口提供程序.)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误:无法找到任何有价值的窗口提供程序.使用 kivy 继承完整"错误:

I have been getting this error: Unable to find any valuable Window provider.With kivy heres the "full" error:

[INFO   ] [Logger      ] Record log in C:UsersVictor.kivylogskivy_17-
05-27_10.txt
[INFO   ] [Kivy        ] v1.10.0
[INFO   ] [Python      ] v3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC
v.1900 32 bit (Intel)]
[INFO   ] [Factory     ] 194 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.
sdl2 - ImportError: DLL load failed: The specified module could not be
found.
File "C:UsersVictorDesktoplibsite-packageskivycore\__init__.py", line
59, in core_select_lib
fromlist=[modulename], level=0)
File "C:UsersVictorDesktoplibsite-
packageskivycorewindowwindow_sdl2.py", line 26, in <module>
from kivy.core.window._window_sdl2 import _WindowSDL2Storage

[CRITICAL] [App         ] Unable to get a Window, abort.
Exception ignored in: 'kivy.properties.dpi2px'
Traceback (most recent call last):
File "C:UsersVictorDesktoplibsite-packageskivyutils.py", line 496, in __get__
 retval = self.func(inst)
 File "C:UsersVictorDesktoplibsite-packageskivymetrics.py", line 174, in dpi
 EventLoop.ensure_window()
 File "C:UsersVictorDesktoplibsite-packageskivyase.py", line 127, in ensure_window
 sys.exit(1)
 SystemExit: 1
[CRITICAL] [App         ] Unable to get a Window, abort.

这是错误,代码如下:

import kivy #added this just in case
from kivy.app import App
from kivy.uix.label import Label


class SimpleKivy(App):
    def build(self):
       return Label(text="Hello World!!!")

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

谁能解释一下这个错误

推荐答案

您可能缺少一些依赖项.来自 docs:

You're probably missing some dependencies. From the docs:

安装依赖项(如果不需要,请跳过 gstreamer (~120MB),请参阅Kivy 的依赖):

python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew;

python -m pip install kivy.deps.gstreamer

要安装这些依赖项,请打开一个终端(可以是控制台、Pycharm 终端窗口等),运行第一个命令,然后运行第二个命令.

To install these dependencies, open up a terminal (can be a console, Pycharm Terminal window, etc.), run the first command and then the second command.

这篇关于Kivy 不工作(错误:无法找到任何有价值的窗口提供程序.)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 04:13
查看更多