2015-06-08 44 views
1

我的RaspberryPi我正在使用Python v3.4.3。Kivy on RaspberryPi(Raspbian) - 無法加載任何有價值的窗口提供者

最近,我(種成功)設法通過以下shell命令在其上安裝Kivy v1.9.1的-dev的:

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 

安裝花了一段時間,但最終,我有這樣的印象,它進展順利。

我改變丕到桌面模式(運行startx),打開外殼,當我嘗試啓動例如「着色」,我得到下面的輸出:

[email protected] ~/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. 

是否有人看到什麼我做錯了,或者有人能幫我找到讓基維跑在我的Pi上的方法嗎?

謝謝。 nnako

回答

1

Kivy需要一個庫來加載png文件。

[INFO ] [Image ] Providers: img_tex, img_dds, img_gif (img_pygame, img_pil, img_ffpyplayer ignored)告訴你它可以加載的東西(tex,dds,gif)以及被忽略的內容。

在python中,加載,保存和操作圖像的'官方'庫是PIL。 您需要安裝PIL或更新的分支:pillow

然後重新啓動你的例子,它應該沒問題。

+0

很好。有用。謝謝。您是否知道Kivy on RaspberryPi是否有全面的整體安裝說明?現在,每個感興趣的人似乎都不得不咀嚼,直到他終於到達某處;-) – nnako

相關問題