Kivy: "Unable to get a Window, abort."

Created on 13 Jul 2018  ·  26Comments  ·  Source: kivy/kivy

Versions

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()
documentation Windows Needs-analysis

Most helpful comment

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!

All 26 comments

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.

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)?

@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.

I've seen similar problems before (maybe try this), but I always try installing into a virtual environment first, to make sure it's not a problem with the package.

I guess you're using your system's installation directly? Did you use pip install ... or pip install --user ...?

Try uninstalling and reinstalling a previous version of kivy.deps.xxx from pypi. You can do it by finding the last version and something like pip install kivy.deps.sdl2==ver, or something like that.

Also, have you tried with only sdl2 and neither glew or angle? Also, make sure you don't have kivy.deps.gstreamer installed and see if it helps.

I have to go to a BBQ right now so I'll try the quicker potential solutions right now, and anything else I'll have to wait until tonight/tomorrow to try.

@dolang Yes, I'm installing directly to my system. I use python -m pip install ... ; I'll definitely go through that forum and see if anything works once I get home tonight. Thanks for the help/replies 👍

@matham I haven't tried with any of those suggested configurations, but I'll quickly try them right now because they should be quick. I'll attempt doing previous versions either tonight or tomorrow, if running only sdl2 or uninstalling gstreamer works. Thanks for the suggestions though!

@matham unfortunately, uninstalling gstreamer, glew, and angle still results in the identical error :(

I've got to go for now, but I'll try everything else late tonight or tomorrow morning. Thanks guys for all the suggestions

@gkub After looking at it for a bit, you might even have a separate problem:

  • Python version doesn't match (3.7 instead of 3.6)
  • According to your StackOverflow question, your installation is in AppData\Local not AppData\Roaming (although that might've changed from 3.6 to 3.7)
  • You're using a 32bit interpreter, not 64bit

You can try adding the folders containing sdl2 and glew to your path. They're probably at:

C:\Users\gkubi\AppData\Local\Programs\Python\Python37-32\share\sdl2
C:\Users\gkubi\AppData\Local\Programs\Python\Python37-32\share\glew

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!

@gkub Could be that it got fixed for you only as a side effect of what you did. Usually, switching to a virtual environment, not away from it, is likely to help. And the sdl2 dependency is clearly there in your comment:

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

Can you put a picture here of how your interpreter screen looks like, and maybe the steps on how you set it up initially? If we can reproduce the problem, it might help us find a real solution to this.

@dolang
How I initally configured my interpreter when it was failing:

failed interpreter setup

The packages screen, with the failing configuration:

failed interpreter packages

The failing "Hello World" button program output, including the SDL2 error (with glew, angle, and gstreamer installed):

failed interpreter run

How I configured my interpreter successfully:

successful interpreter setup

The packages screen for the successful setup:

successful interpreter packages

Hopefully that helps! Disregard the weirdness at the top of the two last images.

@gkub Thanks for that. I haven't gotten around to testing it properly, but that will certainly help a lot.

One thing I've noticed is that you have Inherit global site-packages enabled in that virtualenv. That was probably the culprit in your case, because it mixes the virtual and the global environment, instead of creating one that's completely isolated.

But I have an idea there might be something we can do to handle that case, as well.

The issue has been solved on the Start Overflow, i'll close this one.
A FAQ section is on going to list all the potential issues related to this.

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)?

Yes, I tried with kivy.deps.glew and it didn't work. I'm using python 3.7 and kivy 1.10.1

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!

you are the best !! Dude wasted my 10 hours on this and then found your solutions. Thanks again

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.

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)?

I had the same problem and this solved!

I'm using Pycharm and I've done Settings-> Project Interpreter-> Import kivydepsglew

Finally solved

Thank you

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.

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)?

I had the same problem and this solved!

I'm using Pycharm and I've done Settings-> Project Interpreter-> Import kivydepsglew

Finally solved

Thank you

hey bro ,the module you have installed(kivydepsglew) is not installing in pycharm.
can you help.
Capture

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

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

had a same issue in Visual Studio Code and this works ! thanks !

actually i had the same problem, but as soon as i copy pasted your pip install commands those of which you posted while describing your problem, my basic commands are running already.. i am yet to use full functions for kivy, but hey, thanks right now all of things are working !!
don;t know why but they working !! lol thanks !

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

Work for me in Visual Studio Code, Thanks!!!

You'd have answered in a few more years.

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

Thanks a billion!!!!!!
this worked like charm

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

.... worked!!👍

Was this page helpful?
0 / 5 - 0 ratings