我正在尝试在Kivy中运行一些简单的代码。有人可以帮忙吗? 注意:我的PC上安装了两个硬盘驱动器,我不确定这是否会对路径产生影响。我是新来的。请怜悯我!提前非常感谢您。
这是我要运行的代码:
import kivy
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()
这是我收到的错误:
[INFO ] [Logger ] Record log in C:\Users\Gamer\.kivy\logs\kivy_18-06-25_14.txt
[INFO ] [Kivy ] v1.10.0
[INFO ] [Python ] v3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 07:18:10) [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 "E:\Python36\lib\site-packages\kivy\core\__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "E:\Python36\lib\site-packages\kivy\core\window\window_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 "E:\Python36\lib\site-packages\kivy\utils.py", line 496, in __get__
retval = self.func(inst)
File "E:\Python36\lib\site-packages\kivy\metrics.py", line 174, in dpi
EventLoop.ensure_window()
File "E:\Python36\lib\site-packages\kivy\base.py", line 127, in ensure_window
sys.exit(1)
SystemExit: 1
[CRITICAL] [App ] Unable to get a Window, abort.