Kivy on RaspberryPi (Raspbian) - unable to load any valuable window provider

1.7k views Asked by At

on my RaspberryPi I am using Python v3.4.3 .

Recently, I (kind of successfully) managed to install Kivy v1.9.1-dev on it by the following shell commands:

sudo echo "deb http://vontaene.de/raspbian-updates/ . main" > /etc/apt/sources.list.d/gstreamer.list
sudo apt-get install pkg-config libgl1-mesa-dev libgles2-mesa-dev python-pygame python-setuptools libgstreamer1.0-dev git-core gstreamer1.0-plugins-{bad,base,good,ugly} gstreamer1.0-{omx,alsa} python-dev
sudo pip3.4 install cython
...
cd ~
git clone https://github.com/kivy/kivy
cd kivy
python3.4 setup.py build
sudo python3.4 setup.py install

The installation took quite some hours, but in the end, I had the impression that it went well.

I change the Pi to desktop mode (startx), open a shell and when I try to start the example "shader", I get the following output:

pi@RaspberryPi-02 ~/tools/language__python/FRM__kivy/examples/shader $ python3.4 plasma.py
[INFO   ] [Logger      ] Record log in /home/pi/.kivy/logs/kivy_15-06-08_4.txt
[INFO   ] [Kivy        ] v1.9.1-dev
[INFO   ] [Python      ] v3.4.3 (default, Mar  6 2015, 11:48:01)
[GCC 4.6.3]
[INFO   ] [Factory     ] 175 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_gif (img_pygame, img_pil, img_ffpyplayer ignored)
[INFO   ] [Window      ] Provider: egl_rpi
[INFO   ] [GL          ] OpenGL version <b'OpenGL ES 2.0'>
[INFO   ] [GL          ] OpenGL vendor <b'Broadcom'>
[INFO   ] [GL          ] OpenGL renderer <b'VideoCore IV HW'>
[INFO   ] [GL          ] OpenGL parsed version: 2, 0
[INFO   ] [GL          ] Shading version <b'OpenGL ES GLSL ES 1.00'>
[INFO   ] [GL          ] Texture max size <2048>
[INFO   ] [GL          ] Texture max units <8>
[INFO   ] [Shader      ] fragment shader: <b'Compiled'>
[INFO   ] [Shader      ] vertex shader: <b'Compiled'>
[CRITICAL] [Window      ] Unable to find any valuable Window provider at all!
egl_rpi - Exception: Unknown <png> type, no loader found.
  File "/usr/local/lib/python3.4/site-packages/kivy/core/__init__.py", line 65, in core_select_lib
    cls = cls()
  File "/usr/local/lib/python3.4/site-packages/kivy/core/window/__init__.py", line 625, in __init__
    self.create_window()
  File "/usr/local/lib/python3.4/site-packages/kivy/core/window/window_egl_rpi.py", line 26, in create_window
    super(WindowEglRpi, self).create_window()
  File "/usr/local/lib/python3.4/site-packages/kivy/core/window/__init__.py", line 783, in create_window
    self.render_context = RenderContext()
  File "kivy/graphics/instructions.pyx", line 756, in kivy.graphics.instructions.RenderContext.__init__ (kivy/graphics/instructions.c:10394)
  File "/usr/local/lib/python3.4/site-packages/kivy/core/image/__init__.py", line 511, in __init__
    self.filename = arg
  File "/usr/local/lib/python3.4/site-packages/kivy/core/image/__init__.py", line 699, in _set_filename
    mipmap=self._mipmap, nocache=self._nocache)
  File "/usr/local/lib/python3.4/site-packages/kivy/core/image/__init__.py", line 432, in load
    raise Exception('Unknown <%s> type, no loader found.' % ext)

pygame - ImportError: No module named 'pygame'
  File "/usr/local/lib/python3.4/site-packages/kivy/core/__init__.py", line 57, in core_select_lib
    fromlist=[modulename], level=0)
  File "/usr/local/lib/python3.4/site-packages/kivy/core/window/window_pygame.py", line 8, in <module>
    import pygame

x11 - ImportError: No module named 'kivy.core.window.window_x11'
  File "/usr/local/lib/python3.4/site-packages/kivy/core/__init__.py", line 57, in core_select_lib
    fromlist=[modulename], level=0)

 Traceback (most recent call last):
   File "plasma.py", line 92, in <module>
     PlasmaApp().run()
   File "/usr/local/lib/python3.4/site-packages/kivy/app.py", line 798, in run
     root = self.build()
   File "plasma.py", line 89, in build
     return ShaderWidget(fs=plasma_shader)
   File "plasma.py", line 62, in __init__
     self.canvas = RenderContext()
   File "kivy/graphics/instructions.pyx", line 756, in kivy.graphics.instructions.RenderContext.__init__ (kivy/graphics/instructions.c:10394)
   File "/usr/local/lib/python3.4/site-packages/kivy/core/image/__init__.py", line 511, in __init__
     self.filename = arg
   File "/usr/local/lib/python3.4/site-packages/kivy/core/image/__init__.py", line 699, in _set_filename
     mipmap=self._mipmap, nocache=self._nocache)
   File "/usr/local/lib/python3.4/site-packages/kivy/core/image/__init__.py", line 432, in load
     raise Exception('Unknown <%s> type, no loader found.' % ext)
 Exception: Unknown <png> type, no loader found.

Does anybody see what I did wrong or could anybody help me find ways to get Kivy running on my Pi?

Thanks. nnako

1

There are 1 answers

1
Antonin ENFRUN On BEST ANSWER

Kivy needs a library to load png files.

The line [INFO ] [Image ] Providers: img_tex, img_dds, img_gif (img_pygame, img_pil, img_ffpyplayer ignored) tells you what it can load (tex, dds, gif), and what was ignored.

In python, the 'official' library to load, save and manipulate images is PIL. You need to install PIL, or a more recent fork of it : pillow.

Then restart your example, and it should be fine.