Running kivy on RPi4 from the console

454 views
Skip to first unread message

mjkuwp94

unread,
Mar 24, 2020, 6:29:53 PM3/24/20
to Kivy users support
hello,

I'm not able to get a Window for Kivy running from the console on Raspberry Pi 4.  (have done this lots on the older Raspberry Pi)

at present, this is the error i am getting.

[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: /usr/local/lib/libSDL2_mixer-2.0.so.0: undefined symbol: SDL_RWread
  File "/home/pi/.local/lib/python3.7/site-packages/kivy/core/__init__.py", line 62, in core_select_lib
    fromlist=[modulename], level=0)
  File "/home/pi/.local/lib/python3.7/site-packages/kivy/core/window/window_sdl2.py", line 27, in <module>
    from kivy.core.window._window_sdl2 import _WindowSDL2Storage

I started this fresh today with the Feb 2020 download of Raspbian Desktop ( though I am not using the Desktop)


I followed the directions here:

and I do understand that the sdl2 should not be installed with apt because there are steps in those instructions to compile it.

The exact Kivy installation line that i used is :
python3 -m pip install --user git+https://github.com/kivy/kivy.git@master

that last step of installing Kivy was the most confusing step for me.  There are so many ways to do this but my understanding is that I could not rely on the wheels at piwheels at this time.

I found most of the information i am using by starting here:

and in that conversation it is implied and suggested that Kivy has been updated for this problem.  I do have one specific question - and that is could I install Kivy 1.11.1 instead of 2.0.0release candidate?  My understanding was that I could not since only the current master branch has the fix for getting a Window - but since that did not work for me I must still wonder.

Any thoughts? thanks!

this is the test code I am using
#
import os
os.environ["KIVY_WINDOW"] = "sdl2"
os.environ["KIVY_GL_BACKEND"] = "sdl2"

import kivy
kivy.require("2.0.0")
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()




mjkuwp94

unread,
Mar 25, 2020, 11:51:48 AM3/25/20
to Kivy users support
update, I started over with Raspbian Buster Lite.
After doing the most minimal of setups I followed the instructions and now the test program loads!  so this is partial success. I still would like to have the option of a desktop for the occasional file management or web browsing so I need to either find root cause or attempt installing the desktop on top of what I've done so far.

I attached a log of my Lite installation.
Raspbian_buster_lite_image_build_log_2020.pdf
Reply all
Reply to author
Forward
0 new messages