“Unable to get a Window, abort” running kivy app - python

I'm just starting out with kivy and I can't get over this error.
I'm using pycharm.
[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.
[CRITICAL] [App ] Unable to get a Window, abort.
Here's my code:
import kivy
from kivy.app import App
from kivy.uix.label import Label
class MyApp(App):
def build(self):
return Label(text="Hello world!")
if __name__ == "__main__":
MyApp().run()
Any ideas?

Related

sdl2 - ImportError: DLL load failed while importing _window_sdl2

Python: 3.11.1
kivy: 2.1.0
Im new coding, and im trying to code with kivy using python, but im getting this error:
sdl2 - ImportError: DLL load failed while importing _window_sdl2
i've tried almost every tutorial but no progres made, don't know what to do, this is the code
import kivy
kivy.require("1.0.6")
from kivy.app import App
from kivy.uix.label import Label
class MyApp(App):
def build(App):
return Label(text="Hello World")
if name == "main":
MyApp().run()
i tried fixing it using every tutorial i could find

why does kivy show this error when running?

Hello Helpers,
i installed kivy and the dependencies from kivy.org with pip
when i try to run a simple app
import kivy
from kivy.app import App
from kivy.uix.label import Label
class MyApp(App):
def build(self):
return Label(text="Hello world!!")
if _name__ == '__main__':
MyApp().run()
it shows this error >>
ValueError: kivy._event.EventDispatcher size changed, may indicate binary incompatibility. Expected 40 from C header, got 36 from PyObject
any help Please
UPDATE
SOLUTION
I was using Python V3.8.3 32bit i installed 3.9.2 64bit and reinstall kivy again then it works, that was my solution, i think the issue is in the 32bit version and kivy only runs on 64bit (i just think so), i hope that helps others.

How to import .so files from a packaged kivy android apk?

I'm trying to import .so files in python kivy, which works successfully when ran in Ubuntu but when I package to an apk and try to run it in Android phone, it loads the presplash then exits the app.
Below is the code on test.py
import kivy
from kivy.app import App
from kivy.uix.button import Button
class ButtonApp(App):
def build(self):
btn = Button(text ="hello world")
return btn
def runM():
root = ButtonApp()
root.run()
So I converted the above file(test.py) to test.so file using cython then made a main.py file which calls the runM function
Below is main.py
import test
test.runM()
Problem comes after packaging to apk, before that, everything is working just fine. In my buildozer.spec, source.include_exts I included so extension.
What I'm I missing?
Would appreciate assistance.

Kivy: I'm trying to use MapView and I get the following error: "Downloader error: HTTPError('403 Client Error: Forbidden for url:...)"

I'm trying to integrate MapView in a python-kivy application.
Just for test I run the following code:
from kivy.garden.mapview import MapView
from kivy.app import App
class MapViewApp(App):
def build(self):
mapview = MapView(zoom=11, lat=50.6394, lon=3.057)
return mapview
MapViewApp().run()
But I receive the error: Downloader error: HTTPError('403 Client Error: Forbidden for url: http://b.tile.openstreetmap.org/11/1039/687.png',)
I really cannot find why this doesn't work.
If anyone can help me I'll be extremely thankful.
I was able to solve this problem uninstalling mapview module with garden uninstall mapview and ago installed again: garden install mapview.
If your target platform is android try clear cache: buildozer android clean and ago rebuild your APK.

How to fix kivy is not a package error in command line?

I'm new to kivy and I recently downloaded it to make apps. But whenever I type the following code in my text editor:
import kivy
from kivy.app import App
from kiv.uix.label import Label
class MyApp(App):
def build(self):
return Label(text="Heyo")
if __name__ == "__main__":
MyApp().run()
I get the following error:
No module named "kivy.app"; kivy is not a package
how do I fix this?
It may be that your 'kivy' installation is in venv or outside of where you're trying to call it. Unless you haven't installed it as previously mentioned.

Categories

Resources