kivy: "Unable to get a Window, abort."
Versions
- Python: 3.6
- OS: Windows 10
- Kivy: 1.10.1
- Kivy installation method: https://kivy.org/docs/installation/installation-windows.html#installation
Description
[INFO ] [Logger ] Record log in C:\Users\flamesoff\.kivy\logs\kivy_18-07-13_16.txt
[INFO ] [Kivy ] v1.10.1
[INFO ] [Python ] v3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)]
[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: Не найден указанный модуль.
File "C:\Users\flamesoff\AppData\Roaming\Python\Python36\site-packages\kivy\core\__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "C:\Users\flamesoff\AppData\Roaming\Python\Python36\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.
Reinstalling does not help. Tried this commands several times, it outputs that everything is already installed. But code still does not work.
pip install --upgrade pip wheel setuptools
pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew
pip install kivy.deps.gstreamer
pip install kivy.deps.angle
pip install kivy
Code and Logs
from kivy.app import App
from kivy.uix.button import Button
class TestApp( App ) :
def build( self ) :
return Button( text = 'Hello World' )
TestApp().run()
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 17
- Comments: 32 (8 by maintainers)
I have the exact same problem. I’ve spent easily 8+ hours trying to solve this - reading forums, uninstalling/reinstalling python/kivy, trying different python versions, routing my PATH to umpteen folders, etc - the past two days, and I can NOT figure it out.
I made a question on stack overflow regarding this (it is incorrectly flagged as a duplicate - it’s not). Here’s the link in case I get a response. Hopefully someone has a solution soon, I’m trying everything I can, but at this point I’m at a complete loss. I really just want to get learning kivy.
Someone on my StackOverflow question found another thread with the solution to my problem, and there is a decent likelihood that this is the same issue that OP has.
@FlamesoFF are you using PyCharm to run your code, or another IDE that allows you to create a virtual environment when you select your interpreter for a project? You are likely running a duplicate of python in a virtual environment that (for some reason) does not import all of your python modules.
To fix this, I had to change my project interpreter to an existing interpreter (In PyCharm: File > Settings > Project > Project Interpeter > Existing Interpreter), browse to the location of my original python.exe file (I also had to toggle on “show hidden files” in PyCharm to do so), and set THAT to my interpreter.
This fixed the problem for me - hopefully it does for you as well!
this actually worked for me thanks alot pip install --upgrade pip wheel setuptools pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew pip install kivy.deps.gstreamer pip install kivy.deps.angle
You’d have answered in a few more years.
had a same issue in Visual Studio Code and this works ! thanks !
@dolang I’m not sure about OP, but I’ve tried with only glew installed, only angle installed, and both, and I receive the same error regardless.
Ok, I’ll attempt to reproduce this later. Quick question if you’re watching this: have you already tried to make it work with glew instead of angle (
pip install kivy.deps.glew
)?One more solution for this problem is to install Kivy using pip as previously Kivy was installed through a package manager apt. Running this two worked for me!! sudo apt remove python3-kivy python3 -m pip install kivy
@dolang How I initally configured my interpreter when it was failing:
The packages screen, with the failing configuration:
The failing “Hello World” button program output, including the SDL2 error (with glew, angle, and gstreamer installed):
How I configured my interpreter successfully:
The packages screen for the successful setup:
Hopefully that helps! Disregard the weirdness at the top of the two last images.