从kivy.core.window._window_sdl2导入_WindowSDL2Storage [CRITICAL] [App]无法获取窗口,中止

时间:2019-06-01 10:24:13

标签: python python-3.x windows kivy

我是计算机的新手,所以请放轻松。...

  • 在Windows 10上运行Python 3.7(32位)
  • 使用PyCharm
  • 使用Kivy 1.10.1

运行以下代码:

from kivy.app import App
App().run()

我收到以下错误:

C:\Users\callu\AppData\Local\Programs\Python\Python37-32\python.exe "C:/Users/callu/OneDrive/Documents/Voting app/main.py"
[INFO   ] [Logger      ] Record log in C:\Users\callu\.kivy\logs\kivy_19-06-01_54.txt
[INFO   ] [Kivy        ] v1.10.1
[INFO   ] [Python      ] v3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)]
[INFO   ] [Factory     ] 194 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_gif (img_sdl2, img_pil, img_ffpyplayer ignored)
[CRITICAL] [Window      ] Unable to find any valuable Window provider.
sdl2 - ImportError: DLL load failed: The specified module could not be found.
  File "C:\Users\callu\AppData\Local\Programs\Python\Python37-32\lib\site-packages\kivy\core\__init__.py", line 59, in core_select_lib
    fromlist=[modulename], level=0)
  File "C:\Users\callu\AppData\Local\Programs\Python\Python37-32\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.

我读过大约10个不同的问题,但没有运气能解决我的问题。我尝试添加sdl2并通过以下路线向PATH

C:\Users\callu\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\kivy_deps\sdl2

我已经安装了所有kivy依赖项。奇怪的是,每当我尝试再次安装依赖项时,它说需求已满足,已经安装....但是对于sdl2,我可以继续安装它,但从来没有这样说,它只是像第一次安装文件一样安装。 / p>

1 个答案:

答案 0 :(得分:0)

尝试添加kivy.require('1.10.1')import kivy

import kivy
kivy.require('1.10.1')
from kivy.app import App
App().run()