3

I am trying to get one of the example Kivy codes running on my machine. I am using the Pycharm community edition 2017.1 with anaconda python 2.7 and Kivy 1.9 installed. I have used the project settings to install the Kivy module and the Pygame module into the project. I then run the code:

from kivy.app import App
from kivy.uix.widget import Widget


class PongGame(Widget):
     pass


 class PongApp(App):
     def build(self):
         return PongGame()


 if __name__ == '__main__':
     PongApp().run()

However I get the error:

[INFO   ] [Logger      ] Record log in C:\Users\Rastko\.kivy\logs\kivy_17-
05-08_41.txt
[INFO   ] [Kivy        ] v1.10.0
[INFO   ] [Python      ] v2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 
20:42:59) [MSC v.1500 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\Rastko\AppData\Roaming\Python\Python27\site-
packages\kivy\core\__init__.py", line 59, in core_select_lib
    fromlist=[modulename], level=0)
  File "C:\Users\Rastko\AppData\Roaming\Python\Python27\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.

I suspect i do not have sdl2? Not sure what it s though... Any suggestions?

  • http://stackoverflow.com/questions/40697876/kivy-unable-to-get-a-window-abort http://stackoverflow.com/questions/19113270/trying-to-run-kivy-for-the-first-time http://stackoverflow.com/questions/41741368/kivy-error-unable-to-get-a-window-abort http://stackoverflow.com/questions/40769386/kivy-windows-unable-to-find-any-valuable-window-provider-at-all – Amin Etesamian May 08 '17 at 11:50
  • Why do people use IDE's with Python without understanding how to read the error output. This same question has popped up in the last few days and it directly relates to anaconda and the use of IDE's not pointing to the right paths. You realize you can do anything with official Python that you can do with anaconda if you spend the time looking for the packages or writing your own right? – suroh May 12 '17 at 01:59
  • I do yes, however Anaconda was recommended to me. I have installed the Kivy module into the Pycharm project, this must have not worked properly? – William.Lockett May 15 '17 at 07:35

4 Answers4

2

This will definitely gonna do the trick:

pip install git+https://github.com/kivy/kivy.git@master
codingbruh
  • 2,263
  • 1
  • 13
  • 14
1

when you using Window 7 32 bit system and see this error

try this:>> 1-> open cmd 2->python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew

myhackinfo
  • 29
  • 3
0

kivy uses pygame to create/ build a window so probably it's missing. try:

pip(3) install pygame
rick.m
  • 11
  • 2
0

Use this if you are using python3.x.x versions in Windows:

  • pip3 install pygame
dgamer
  • 155
  • 2
  • 3