打开奇异果窗有问题

时间:2019-05-10 07:47:23

标签: python python-3.x kivy kivy-language

当我运行此简单代码时,无法打开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()

这是我将导入更改为一个人建议的名称后得到的,但仍然无法打开窗口。请帮忙!

[INFO   ] [Logger      ] Record log in C:\Users\dorijan\.kivy\logs\kivy_19-05-07_0.txt
[INFO   ] [Kivy        ] v1.10.1
[INFO   ] [Python      ] v3.6.7 (v3.6.7:6ec5cf24b7, Oct 20 2018, 13:35:33) [MSC v.1900 64 bit (AMD64)]
[INFO   ] [Factory     ] 194 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Window      ] Provider: sdl2
[CRITICAL] [Window      ] Unable to find any valuable Window provider.
sdl2 - ImportError: DLL load failed: The specified module could not be found.
  File "C:\PycharmProjects\app.py\venv\lib\site-packages\kivy\core\__init__.py", line 67, in core_select_lib
    cls = cls()
  File "C:\PycharmProjects\app.py\venv\lib\site-packages\kivy\core\window\window_sdl2.py", line 140, in __init__
    super(WindowSDL, self).__init__()
  File "C:\PycharmProjects\app.py\venv\lib\site-packages\kivy\core\window\__init__.py", line 968, in __init__
    self.create_window()
  File "C:\PycharmProjects\app.py\venv\lib\site-packages\kivy\core\window\window_sdl2.py", line 272, in create_window
    self.fullscreen, resizable, state)
  File "kivy\core\window\_window_sdl2.pyx", line 125, in kivy.core.window._window_sdl2._WindowSDL2Storage.setup_window
  File "kivy\graphics\cgl.pyx", line 52, in kivy.graphics.cgl.cgl_get_backend_name
  File "kivy\graphics\cgl.pyx", line 60, in kivy.graphics.cgl.cgl_get_backend_name
  File "C:\Python36\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 571, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 922, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed

[CRITICAL] [App         ] Unable to get a Window, abort.

Process finished with exit code 1

0 个答案:

没有答案