Kivy错误 - “无法获取窗口,中止”

时间:2017-01-19 12:04:14

标签: python window kivy x11 sdl-2

我在我的Raspberry pi3上安装了kivy,在那里我运行了一个已经在另一个pi3上工作的python程序。

我现在正在尝试在第二个pi上安装相同的东西,它不起作用...也许我忘了一些东西,但我想我做了所有与以前相同的步骤..

kivy确实安装得很好,就像python程序的其他软件包一样。

下面是错误:

pi@raspberrypi:~ $ python pi4.py
[INFO   ] [Logger      ] Record log in /home/pi/.kivy/logs/kivy_17-01-19_4.txt
[INFO   ] [Kivy        ] v1.9.2-dev0
[INFO   ] [Python      ] v2.7.9 (default, Sep 17 2016, 20:26:04) 
[GCC 4.9.2]
[INFO   ] [Factory     ] 193 symbols loaded
[INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO   ] [Text        ] Provider: sdl2
[INFO   ] [Window      ] Provider: egl_rpi
[INFO   ] [OSC         ] using <multiprocessing> for socket
[INFO   ] [Window      ] Provider: sdl2(['window_egl_rpi'] ignored)
[CRITICAL] [Window      ] Unable to find any valuable Window provider.
egl_rpi - TypeError: 'NoneType' object has no attribute '__getitem__'
  File "/usr/local/lib/python2.7/dist-packages/kivy/core/__init__.py", line 67, in core_select_lib
    cls = cls()
  File "/usr/local/lib/python2.7/dist-packages/kivy/core/window/__init__.py", line 817, in __init__
    super(WindowBase, self).__init__(**kwargs)
  File "kivy/_event.pyx", line 273, in kivy._event.EventDispatcher.__init__ (/tmp/pip-IRRRCt-build/kivy/_event.c:5375)
  File "kivy/properties.pyx", line 423, in kivy.properties.Property.__set__ (/tmp/pip-IRRRCt-build/kivy/properties.c:5171)
  File "kivy/properties.pyx", line 1416, in kivy.properties.AliasProperty.set (/tmp/pip-IRRRCt-build/kivy/properties.c:23280)
  File "/usr/local/lib/python2.7/dist-packages/kivy/core/window/__init__.py", line 701, in _set_top
    self._set_window_pos(pos[0], value)

sdl2 - RuntimeError: Couldn't find matching GLX visual
  File "/usr/local/lib/python2.7/dist-packages/kivy/core/__init__.py", line 67, in core_select_lib
    cls = cls()
  File "/usr/local/lib/python2.7/dist-packages/kivy/core/window/window_sdl2.py", line 139, in __init__
    super(WindowSDL, self).__init__()
  File "/usr/local/lib/python2.7/dist-packages/kivy/core/window/__init__.py", line 841, in __init__
    self.create_window()
  File "/usr/local/lib/python2.7/dist-packages/kivy/core/window/window_sdl2.py", line 263, in create_window
    self.fullscreen, resizable, state)
  File "kivy/core/window/_window_sdl2.pyx", line 142, in kivy.core.window._window_sdl2._WindowSDL2Storage.setup_window (/tmp/pip-IRRRCt-build/kivy/core/window/_window_sdl2.c:2458)
  File "kivy/core/window/_window_sdl2.pyx", line 57, in kivy.core.window._window_sdl2._WindowSDL2Storage.die (/tmp/pip-IRRRCt-build/kivy/core/window/_window_sdl2.c:1569)

x11 - ImportError: No module named window_x11
  File "/usr/local/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.

1 个答案:

答案 0 :(得分:0)

您现在应该可以通过运行

解决此问题
sudo apt-get install \ 
    libsdl2-2.0-0 \ 
    libsdl2-image-2.0-0 \ 
    libsdl2-mixer-2.0-0 \ 
    libsdl2-ttf-2.0-0