关于raspberry pi 3的Kivy错误:没有名为window x11的模块

时间:2016-04-21 13:41:27

标签: python raspberry-pi kivy

我正在为raspberry pi 3运行最新的Raspbian Jessie图像,并试图运行一个kivy应用程序,我无法修复此错误。

[INFO   ] [Logger      ] Record log in /root/.kivy/logs/kivy_16-04-06_5.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)

1 个答案:

答案 0 :(得分:0)

我花了大约2个小时尝试各种不同的事情,但最终我发现它需要一个由于某种原因未安装或未按要求列出的依赖项:pygame。只需运行pip3 install pygame。然后尝试再次运行您的代码,它应该可以正常运行。这对我的MacBook Pro上的Lubuntu 18.04 VM有用。