我有一些python 2.7代码使用Kivy安装并在Raspberry Pi上完美运行但它在BeagleBone Black Rev C上崩溃。代码导入:
from kivy import app
from kivy import clock
from kivy.uix import anchorlayout
from kivy.uix import label
from kivy.core import window
我在Debian Jessie的BeagleBone Black Rev C上运行python 2.7。 Kivy版本1.9.1。这是错误:
[INFO ] [Logger ] Record log in /root/.kivy/logs/kivy_16-04-01_6.txt
[INFO ] [Kivy ] v1.9.1
[INFO ] [Python ] v2.7.9 (default, Mar 1 2015, 13:48:22)
[GCC 4.9.2]
[INFO ] [Factory ] 179 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_gif, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
[INFO ] [OSC ] using <multiprocessing> for socket
[INFO ] [Window ] Provider: sdl2(['window_egl_rpi'] ignored)
error: XDG_RUNTIME_DIR not set in the environment.
[CRITICAL] [Window ] Unable to find any valuable Window provider at all!
egl_rpi - ImportError: cannot import name bcm
File "/usr/lib/python2.7/dist-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
File "/usr/lib/python2.7/dist-packages/kivy/core/window/window_egl_rpi.py", line 12, in <module>
from kivy.lib.vidcore_lite import bcm, egl
sdl2 - RuntimeError: No available video device
File "/usr/lib/python2.7/dist-packages/kivy/core/__init__.py", line 67, in core_select_lib
cls = cls()
File "/usr/lib/python2.7/dist-packages/kivy/core/window/window_sdl2.py", line 138, in __init__
super(WindowSDL, self).__init__()
File "/usr/lib/python2.7/dist-packages/kivy/core/window/__init__.py", line 722, in __init__
self.create_window()
File "/usr/lib/python2.7/dist-packages/kivy/core/window/window_sdl2.py", line 237, in create_window
self.fullscreen, resizable, state)
File "_window_sdl2.pyx", line 80, in kivy.core.window._window_sdl2._WindowSDL2Storage.setup_window (kivy/core/window/_window_sdl2.c:1810)
File "_window_sdl2.pyx", line 55, in kivy.core.window._window_sdl2._WindowSDL2Storage.die (kivy/core/window/_window_sdl2.c:1460)
x11 - ImportError: No module named window_x11
File "/usr/lib/python2.7/dist-packages/kivy/core/__init__.py", line 59, in core_select_lib
fromlist=[modulename], level=0)
[CRITICAL] [App ] Unable to get a Window, abort.
编辑:进步!我需要安装Cython。一旦我这样做,我就会遇到以下错误:
[ERROR ] [Window ] Unable to use pygame
[ERROR ] [Window ] The module raised an important error: 'OpenGL not available'
答案 0 :(得分:1)
在Debian上安装Kivy软件包的最简单方法是添加Kivy存储库。
详细说明可在此处找到:https://kivy.org/docs/installation/installation-linux.html
实际上,归结为将以下行添加到/etc/apt/sources.list
:
deb http://ppa.launchpad.net/kivy-team/kivy/ubuntu trusty main
然后在以下位置运行此命令:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A863D2D6
之后你可以安装Kivy:
sudo apt-get install python-kivy