Hello,
I have had success with Kivy running from the console on Raspberry pi 3B, 3B+ and 4. Most recently I had set up Raspberry Pi with the 64-bit Raspberry Pi OS and I found almost everything worked better -like a dream. The mouse finally works without the Python module and several data science libraries installed very easily after changing to 64-bit.
However, I ran into a snag when building a new Raspberry Pi reTerminal which uses a CM4. This has worked on the 32-bit OS and also worked for Python 3.11 and Python 3.9. I just have to be careful to install the prerequisites and set the environment variables accordingly.
likethis:
KIVY_RPI_VERSION=4
KIVY_SDL2_PATH=/usr/local/lib
KIVY_GL_BACKEND=sdl2
KIVY_NO_ARGS=1
KIVY_TEXT=sdl2
KIVY_WINDOW=sdl2
However, after Numerous tries with various install methods and different Python versions, including the built in 3.9.2, I cannot get past the loading of the Window and get errors like this:
[DEBUG ] [Cache ] register <kv.resourcefind> with limit=None, timeout=60
[DEBUG ] [Cache ] register <kv.lang> with limit=None, timeout=None
[DEBUG ] [Cache ] register <kv.image> with limit=None, timeout=60
[DEBUG ] [Cache ] register <kv.atlas> with limit=None, timeout=None
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[DEBUG ] [Cache ] register <kv.texture> with limit=1000, timeout=60
[DEBUG ] [Cache ] register <kv.shader> with limit=1000, timeout=3600
[DEBUG ] [Cache ] register <kv.graphics.texture> with limit=None, timeout=None
[INFO ] [Text ] Provider: sdl2
[DEBUG ] [App ] Loading kv </home/pi/archive_install/my.kv>
[DEBUG ] [App ] kv </home/pi/archive_install/my.kv> not found
[INFO ] [Window ] Provider: sdl2
[DEBUG ] [Window ] Provider <x11> ignored by config
[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 - UnboundLocalError: local variable 'dpi' referenced before assignment
File "/home/pi/py39/lib/python3.9/site-packages/kivy/core/__init__.py", line 71, in core_select_lib
cls = cls()
File "/home/pi/py39/lib/python3.9/site-packages/kivy/core/window/window_sdl2.py", line 165, in __init__
super(WindowSDL, self).__init__()
File "/home/pi/py39/lib/python3.9/site-packages/kivy/core/window/__init__.py", line 1102, in __init__
self.create_window()
File "/home/pi/py39/lib/python3.9/site-packages/kivy/core/window/window_sdl2.py", line 322, in create_window
self._update_density_and_dpi()
File "/home/pi/py39/lib/python3.9/site-packages/kivy/core/window/window_sdl2.py", line 422, in _update_density_and_dpi if self.dpi != dpi:
[CRITICAL] [App ] Unable to get a Window, abort.
--------------------
in window_sdl2.py there is a statement that is detecting self._is_desktop and this seems to be evaluating to True from the windows Core but I am not running the code from the desktop. It must be getting fooled by the 64-bit architecture or some related change.
On different tries, I have had different flavors of error but never get past the Window provider.
Any ideas for further troubleshooting?
thanks!