4

I've been trying to run the 'hello world' test code from the kivy website, and I can't seem to get it to work. I'm using PyCharm 2018 1.4x64, running Python 3.7, and I've installed the most recent version of Kivy (1.10.1)

I've followed every step on the kivy install instructions, uninstalled and reinstalled all of the packages (using pip), and the kivy website does say that python 3.7 is supported.

Any help resolving this issue would be seriously appreciated! I've spent too much time trying to debug this, I've read through dozens of forums, installed, uninstalled and reinstalled everything multiple times, installed pillow and added new directories to my PATH, and nothing has worked. Not sure what else to try.

Here is the code I'm trying to run:

from kivy.app import App
from kivy.uix.button import Button

class TestApp(App):
    def build(self):
        return Button(text='Hello World')

TestApp().run()

Here is the output I'm getting:

C:\Users\gkubi\venv\Scripts\python.exe "C:/Users/gkubi/Desktop/My Programming/Python Programs/Kivy/test"

[INFO   ] [Logger      ] Record log in C:\Users\gkubi\.kivy\logs\kivy_18-07-14_3.txt

[INFO   ] [Kivy        ] v1.10.1

[INFO   ] [Python      ] v3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47)     [MSC v.1914 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:\Users\gkubi\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\gkubi\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.

Process finished with exit code 1

Also, to update, I uninstalled and deleted Python 3.7, deleted all user AppData folders/files for all things Python and Kivy related, installed Python 3.6.6, installed Kivy + its dependencies again as instructed here: https://kivy.org/docs/installation/installation-windows.html , updated my PATH respectively to Python 3.6.6, and I still get identical errors.

g_kub
  • 74
  • 7
  • 1
    @eyllanesc thanks for the reply. Unfortunately none of those solutions worked for me (and since I'm not using virtual software, the hardware acceleration settings adjustment is not an option). To clarify, I have un/reinstalled kivy AND all of its dependencies listed on the kivy website at least 5 times by now. Also - it may be worth mentioning - prior to receiving this error, I was receiving another error indicating that PIL (which I believe it is typically installed with kivy or its dependencies) is not found. I manually installed pillow to fix that, but then began to receive this error – g_kub Jul 14 '18 at 23:42
  • 1
    whats is your OS? – eyllanesc Jul 14 '18 at 23:46
  • 1
    @eyllanesc Windows 10 - and I've done all my installations using pip – g_kub Jul 14 '18 at 23:47
  • 1
    what is the output of: `pip freeze`.? – eyllanesc Jul 14 '18 at 23:50
  • 1
    @eyllanesc certifi==2018.4.16 chardet==3.0.4 docutils==0.14 idna==2.7 Kivy==1.10.1 Kivy-Garden==0.1.4 kivy.deps.angle==0.1.7 kivy.deps.glew==0.1.10 kivy.deps.gstreamer==0.1.13 kivy.deps.sdl2==0.1.18 Pillow==5.2.0 pygame==1.9.3 Pygments==2.2.0 pypiwin32==223 pywin32==223 requests==2.19.1 urllib3==1.23 – g_kub Jul 14 '18 at 23:51
  • 1
    @g_kub: SDL2 is not installed in your venv. Please refer to [sdl2 - ImportError: DLL load failed: The specified module could not be found.](https://stackoverflow.com/questions/49466785/kivy-error-python-2-7-sdl2-import-error/49477111#49477111) – ikolim Jul 15 '18 at 15:34
  • 1
    Thank you @ikolim , I can't believe how much time I spent on this for such a simple fix. I never realized I was running python in a venv instead of the original file, wow. – g_kub Jul 15 '18 at 21:31

0 Answers0