Quantcast
Viewing all articles
Browse latest Browse all 14069

Kivy not working Error - [CRITICAL] [App ] Unable to get a Window, abort

I am new to Kivy and I try to run this code

# Set window provider before importing other Kivy modules Config.set('graphics', 'window_state', 'visible')Config.set('graphics', 'width', '400') Config.set('graphics','height', '200') Config.set('graphics', 'window_backend', 'x11')Config.write()from kivy.app import App from kivy.uix.button import Button fromkivy.uix.label import Label from kivy.uix.boxlayout import BoxLayoutclass MyApp(App):    def build(self):        layout = BoxLayout(orientation='vertical')        self.label = Label(text='Hello, Kivy!')        layout.add_widget(self.label)        self.button = Button(text='Click me!')        self.button.bind(on_press=self.on_button_click)        layout.add_widget(self.button)        return layout    def on_button_click(self, instance):        self.label.text = 'Button clicked!'if __name__ == '__main__':    MyApp().run()

i tried also to install it from github and a diffrent ways when i runthis code i get this error

> C:\Users\Administrator\env\Scripts\python.exe C:\Users\Administrator\Desktop\project.py > [INFO   ] [Logger      ] Record log in C:\Users\Administrator\.kivy\logs\kivy_24-02-18_55.txt> [INFO   ] [deps        ] Successfully imported "kivy_deps.gstreamer" 0.3.3> [INFO   ] [deps        ] Successfully imported "kivy_deps.angle" 0.4.0> [INFO   ] [deps        ] Successfully imported "kivy_deps.glew" 0.3.1> [INFO   ] [deps        ] Successfully imported "kivy_deps.sdl2" 0.7.0> [INFO   ] [Kivy        ] v2.3.0> [INFO   ] [Kivy        ] Installed at "C:\Users\Administrator\env\lib\site-packages\kivy\__init__.py"> [INFO   ] [Python      ] v3.10.0 (tags/v3.10.0:b494f59, Oct  4 2021, 19:00:18) [MSC v.1929 64 bit (AMD64)]> [INFO   ] [Python      ] Interpreter at "C:\Users\Administrator\env\Scripts\python.exe"> [INFO   ] [Logger      ] Purge log fired. Processing...> [INFO   ] [Logger      ] Purge finished!> [INFO   ] [Factory     ] 195 symbols loaded> [INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)> [INFO   ] [Text        ] Provider: sdl2> [INFO   ] [Window      ] Provider: sdl2> [INFO   ] [GL          ] Using the "OpenGL" graphics system> [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 - ValueError: angle_sd12 is not a recognized GL backend> File "C:\Users\Administrator\env\lib\site-packages\kivy\core\__init__.py", line 71, in core_select_lib> cls = cls()> File "C:\Users\Administrator\env\lib\site-packages\kivy\core\window\window_sdl2.py", line 165, in __init__> super(WindowSDL, self).__init__()> File "C:\Users\Administrator\env\lib\site-packages\kivy\core\window\__init__.py", line 1129, in __init__> self.create_window()> File "C:\Users\Administrator\env\lib\site-packages\kivy\core\window\window_sdl2.py", line 361, in create_window> super(WindowSDL, self).create_window()> File "C:\Users\Administrator\env\lib\site-packages\kivy\core\window\__init__.py", line 1495, in create_window> self.initialize_gl()> File "C:\Users\Administrator\env\lib\site-packages\kivy\core\window\__init__.py", line 1465, in initialize_gl> init_gl(allowed=self.gl_backends_allowed,> File "C:\Users\Administrator\env\lib\site-packages\kivy\core\gl\__init__.py", line 45, in init_gl> gl_init_symbols(allowed, ignored)> File "kivy\\graphics\\opengl.pyx", line 1556, in kivy.graphics.opengl.gl_init_symbols> File "kivy\\graphics\\cgl.pyx", line 113, in kivy.graphics.cgl.cgl_init> > [CRITICAL] [App         ] Unable to get a Window, abort.> > Process finished with exit code 1 

iam using PyCharm and i installed this pkgs with all ways that i coulddo my packages i also try torun it on vs code and manually without IDE and tried to uninstall allthis pkgs and reinstall them and nothing change


Viewing all articles
Browse latest Browse all 14069

Trending Articles