2

All the solutions that am seeing for this Kivy error does not work for me. It has been more tha 2 weeks now yet all my efforts are in vain. Am using python 3.6.4, kivy 1.10.1, pycharm as my IDE and Windows 10. here is the error code and the code itself:

The Code:

from kivy.core.window import Window
import os
os.environ['KIVY_GL_BACKEND'] = 'angel_sdl2'
from kivy.app import App
from kivy.uix.button import Button

# from kivy import Config
# Config.set('graphics', 'multisamples', '0')

class MyApp(App):
  def build(self):
     return Button(text='Hello world')


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

The Error:

enter code here"C:\Program Files\Python36-32\python.exe" 
"C:/Users/Sabinus O Ofoleta/Desktop/python/tested.py"
[INFO   ] [Logger      ] Record log in C:\Users\Sabinus O    Ofoleta\.kivy\logs\kivy_19-02-21_4.txt
[INFO   ] [Kivy        ] v1.10.1
 [INFO   ] [Python      ] v3.6.7 (v3.6.7:6ec5cf24b7, Oct      20 2018, 12:45:02) [MSC v.1900 32 bit (Intel)]
 [INFO   ] [Factory     ] 194 symbols loaded
 [INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
 [INFO   ] [Text        ] Provider: sdl2
 [INFO   ] [Window      ] Provider: sdl2
 [INFO   ] [Window      ] Activate GLES2/ANGLE context
 [CRITICAL] [Window      ] Unable to find any valuable  Window provider.
 sdl2 - RuntimeError: b'Could not initialize EGL'
 File "C:\Program Files\Python36-32\Lib\site-packages   \kivy\core\__init__.py", line 67, in core_select_lib
  cls = cls()
 File "C:\Program Files\Python36-32\Lib\site-packages \kivy\core\window\window_sdl2.py", line 140, in __init__
super(WindowSDL, self).__init__()
 File "C:\Program Files\Python36-32\Lib\site-packages\kivy\core\window\__init__.py", line 968, in __init__
self.create_window()
 File "C:\Program Files\Python36-32\Lib\site-packages\kivy\core\window\window_sdl2.py", line 272, in create_window
self.fullscreen,resizable , state)
 File "kivy\core\window\_window_sdl2.pyx", line 209, in kivy.core.window._window_sdl2._WindowSDL2Storage.setup_window
 File "kivy\core\window\_window_sdl2.pyx", line 66, in kivy.core.window._window_sdl2._WindowSDL2Storage.die

 [CRITICAL] [App         ] Unable to get a Window, abort.

 Process finished with exit code 1

My computer is using opengl 1.1 because other versions are not compatible so I dicided to use 'angel_sdl2'. Thanks

Bruno
  • 655
  • 8
  • 18

3 Answers3

2

I find it hard to believe that a computer that can run windows 10 can't run more recent versions of opengl than 1.1, which is more than 20 years old, OpenGL ES 2.0 itself being more than 10 years old. What's more likely, is that you don't have drivers for your GPU installed. Even to use angle_sdl2, you need to have DirectX 11 working, as angle is simply an implementation of OpenGL on top of it.

Tshirtman
  • 5,859
  • 1
  • 19
  • 26
  • I have actually searched the entire net for opengl 2.0 but I couldn't find it, all I could see was opengl 4.6. In other words I used opengl extension viewer and in the graphics report it highlighted only opengl 1.1 with a green bullet as supported(compatible) and other versions from opengl 1.2 to 4.6 as not supported. But I will check to see if DirectX 11 is actually working. Thanks for the reply. – Bruno Feb 24 '19 at 23:55
  • Yeah, it's OpenGL ES 2.0, for *embedded systems*, designed mainly for things like android/ios devices, but also supported on desktops, because it's a useful subset of OpengGL 3 (afaik, not an expert in the API differences between them). Are you using some remote desktop solution or something? It's not uncommon for them to break support for acceleration. – Tshirtman Feb 25 '19 at 09:49
  • No am not using remote desktop solutions. Do you know if there is a way I can run sudo apt-get on windows someone suggested this solution to my above problem. sudo apt-get install \ libsdl2-2.0-0 \ libsdl2-image-2.0-0 \ libsdl2-mixer-2.0-0 \ libsdl2-ttf-2.0-0 – Bruno Feb 25 '19 at 10:45
  • no apt-get on windows, this solution is for linux anyway, for windows, the equivalent is `pip install kivy.deps.sdl2` – Tshirtman Feb 25 '19 at 11:19
  • OK. But I have done pip install Kivy.deps.sdl2 several times now it's not working. Maybe I should be thinking of getting a new laptop, can you suggest any? – Bruno Feb 25 '19 at 12:05
  • Can you tell what you currently have, unless it's over 10 years old, i doubt that the issue is hardware. – Tshirtman Feb 25 '19 at 14:43
  • Dell inspiron 1525 . Intel Celeron Dual Core – Bruno Feb 25 '19 at 17:19
  • Ok, that's a bit old, and its integrated GPU is certainly the cause of the issue https://en.wikipedia.org/wiki/Intel_GMA#GMA_X3100 you might want to try under linux, as the driver here supports OpenGL 2.1, but i'm not even sure that'll be enough, so yeah, i would advise getting something, anything, newer. It's a bit hard to tell you what to buy, being neither a hardware expert or aware of your budget, but any laptop less than 5 years is a good bet, in case you are not sure, lookup the graphic card specifications before buying, making sure it supports at least OpenGL 3 or ES 2.0. – Tshirtman Feb 26 '19 at 12:53
  • Sure. Thanks I appreciate – Bruno Feb 27 '19 at 02:37
2

Same issue on a laptop with Intel GMA 965 and Win10

The reason: graphics driver is outdated, no new versions.

The solution (worked for me):

1) Apply tool by pal1000 https://github.com/pal1000/save-legacy-intel-graphics

(more info at https://community.khronos.org/t/i-have-opengl-3-1-but-kivy-says-that-i-have-only-1-1/103980/6)

2) Install dependencies, like

python -m pip install --ignore-installed kivy.deps.sdl2 kivy.deps.glew

(and set system variable "KIVY_GL_BACKEND" to "glew", or don't set - this is default value; btw installing kivy.deps.angle and setting "angle_sdl2" don't help me in this case)

3) Add this before python code:

from kivy import Config
Config.set('graphics', 'multisamples', '0')

(from Kivy does not detect OpenGL 2.0)

0

I found a solution to this problem; copy all the files in your C:\Python27\share\sdl2\bin or whatever the path that has your sdl2 folder. Paste those files in System32 and SysWOW64 folders.

mechnicov
  • 12,025
  • 4
  • 33
  • 56