Kivy cannot find valuable window

0

I'm trying to follow a kivy tutorial, and the test code is this:

import kivy
from kivy.app import App
from kivy.uix.label import Label

class myApp(App):

    def build(self):
        return Label(text="Tech With Tim")


if __name__ == "__main__":

    myApp().run()

However, I am getting this in the console:

[INFO   ] [Logger      ] Record log in C:\Users\ultra\.kivy\logs\kivy_20-04-26_1.txt
[INFO   ] [deps        ] Successfully imported "kivy_deps.gstreamer" 0.2.0
[INFO   ] [deps        ] Successfully imported "kivy_deps.angle" 0.2.0
[INFO   ] [deps        ] Successfully imported "kivy_deps.glew" 0.2.0
[INFO   ] [deps        ] Successfully imported "kivy_deps.sdl2" 0.2.0
[INFO   ] [Kivy        ] v2.0.0rc1, git-ae0fa0c, 20191229
[INFO   ] [Kivy        ] Installed at "C:\Users\ultra\AppData\Roaming\Python\Python38\site-packages\kivy\__init__.py"
[INFO   ] [Python      ] v3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)]
[INFO   ] [Python      ] Interpreter at "C:\Program Files (x86)\Python38-32\python.exe"
[INFO   ] [Factory     ] 184 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. Please enable debug logging (e.g. add -d if running from the command line, or change the log level in the config) and re-run your app to identify potential causes
sdl2 - ImportError: DLL load failed while importing _window_sdl2: The specified module could not be found.
  File "C:\Users\ultra\AppData\Roaming\Python\Python38\site-packages\kivy\core\__init__.py", line 58, in core_select_lib
    mod = __import__(name='{2}.{0}.{1}'.format(
  File "C:\Users\ultra\AppData\Roaming\Python\Python38\site-packages\kivy\core\window\window_sdl2.py", line 27, in <module>
    from kivy.core.window._window_sdl2 import _WindowSDL2Storage

[CRITICAL] [App         ] Unable to get a Window, abort.
1
Stack trace:
 >  File "C:\Users\ultra\Desktop\Python Scripts\The App\Kivy Tutorial\kivyAppTutorial.py\kivyAppTutorial.py\kivyAppTutorial.py.py", line 8, in build
 >    return Label(text="Tech With Tim")
 >  File "C:\Users\ultra\Desktop\Python Scripts\The App\Kivy Tutorial\kivyAppTutorial.py\kivyAppTutorial.py\kivyAppTutorial.py.py", line 13, in <module>
 >    myApp().run()
Loaded '__main__'
Loaded 'kivy.app'
Loaded 'runpy'
The program 'python.exe' has exited with code -1 (0xffffffff).

I have no idea how to fix this. Some similar problems are saying its an installation issue, but I followed the installation exactly, and the solutions aren't working either. Any help would be much appreciated.

I am running python 3.8.1 on Windows 10. It failed in both Visual Studio as well as running a .py file via cmd.

python
windows
kivy
asked on Stack Overflow Apr 26, 2020 by Thrasherop

1 Answer

1

Run the below pip command and try to execute the program again!

python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew --extra-index-url https://kivy.org/downloads/packages/simple/

This might solve your problem!

answered on Stack Overflow Apr 27, 2020 by Balaji Ramachandran

User contributions licensed under CC BY-SA 3.0