在Ubuntu升级后,我的kivy应用程序不再在我的Ubuntu计算机上运行

时间:2017-01-26 10:10:06

标签: ubuntu pip virtualenv kivy

(适用解决)

我曾经在我的Ubuntu 14.04计算机上运行kivy应用程序。基维确实跑得很好。 然后我决定从Ubuntu 14.04升级到Ubuntu 16.04。 升级过程(在线)很顺利。

不幸的是,自升级以来,我所有的kivy应用程序都不想再运行了。他们停止了这个错误:

##################################### snip
[INFO        ] [Kivy        ] v1.9.1
[INFO        ] [Python      ] v2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609]
[INFO        ] [Factory     ] 179 symbols loaded
[INFO        ] [Image       ] Providers: img_tex, img_dds, img_gif, img_sdl2 (img_pil, img_ffpyplayer ignored)
[INFO        ] [OSC         ] using <multiprocessing> for socket
[INFO        ] [Window      ] Provider: sdl2(['window_egl_rpi'] ignored)
[CRITICAL    ] [Window      ] Unable to find any valuable Window provider at all!
egl_rpi - ImportError: cannot import name bcm
##################################### snip

注意:kivy是通过virtualenv中的pip安装的。

我决定销毁我的virtualenv并重新创建并通过pip install重新安装。这是我的点子清单:

##################################### snip
appdirs (1.4.0)
buildozer (0.32)
colorama (0.3.7)
Cython (0.23)
docutils (0.13.1)
Jinja2 (2.8)
Kivy (1.9.1)
Kivy-Garden (0.1.4)
MarkupSafe (0.23)
packaging (16.8)
pexpect (4.2.1)
pip (9.0.1)
pkg-resources (0.0.0)
ptyprocess (0.5.1)
pyparsing (2.1.10)
requests (2.13.0)
setuptools (34.0.2)
sh (1.12.9)
six (1.10.0)
virtualenv (15.1.0)
wheel (0.30.0a0)
##################################### snip

重要提及:

我确实按照以下注意事项发现: https://kivy.org/docs/installation/installation-linux.html#dependencies-with-sdl2

所以我做的是:

  • 我安装了所有SDL2库
  • 我安装了Cython版本0.23
  • 我安装了kivy:pip install Kivy --no-cache-dir

不幸的是,当我启动一个kivy app时,它会停在上面的错误中。

我尝试了别的东西:

我通过Ubuntu软件包安装了kivy:同样的错误!!!

所以我的想法是:

可能存在一些东西(库/某些库)阻止kivy应用程序运行,但是什么?

总结:

  • 通过pip install安装kivy启动
  • 使用apt-get install
  • 安装kivy

两种方法都以相同的错误结束。

无论我做什么,我总会得到同样的错误。

任何帮助真的很感激! 感谢

PS:这是发布的完整输出。有这一行:

x11 - ImportError: No module named window_x11

我不知道它是否有帮助。

以下完整输出:

################################ snip
[INFO              ] [Logger      ] Record log in /home/richard/.kivy/logs/kivy_17-01-26_1.txt
[INFO              ] [Kivy        ] v1.9.1
[INFO              ] [Python      ] v2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609]
[INFO              ] [Factory     ] 179 symbols loaded
[INFO              ] [Image       ] Providers: img_tex, img_dds, img_gif, img_sdl2 (img_pil, img_ffpyplayer ignored)
[INFO              ] [OSC         ] using <multiprocessing> for socket
[INFO              ] [Window      ] Provider: sdl2(['window_egl_rpi'] ignored)
[CRITICAL          ] [Window      ] Unable to find any valuable Window provider at all!
egl_rpi - ImportError: cannot import name bcm
  File "/home/richard/programmation/python/tests/kivy/kv_and_py/env/local/lib/python2.7/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
    fromlist=[modulename], level=0)
  File "/home/richard/programmation/python/tests/kivy/kv_and_py/env/local/lib/python2.7/site-packages/kivy/core/window/window_egl_rpi.py", line 12, in <module>
    from kivy.lib.vidcore_lite import bcm, egl

sdl2 - RuntimeError: Could not create GL context: BadValue (integer parameter out of range for operation)
  File "/home/richard/programmation/python/tests/kivy/kv_and_py/env/local/lib/python2.7/site-packages/kivy/core/__init__.py", line 67, in core_select_lib
    cls = cls()
  File "/home/richard/programmation/python/tests/kivy/kv_and_py/env/local/lib/python2.7/site-packages/kivy/core/window/window_sdl2.py", line 138, in __init__
    super(WindowSDL, self).__init__()
  File "/home/richard/programmation/python/tests/kivy/kv_and_py/env/local/lib/python2.7/site-packages/kivy/core/window/__init__.py", line 722, in __init__
    self.create_window()
  File "/home/richard/programmation/python/tests/kivy/kv_and_py/env/local/lib/python2.7/site-packages/kivy/core/window/window_sdl2.py", line 237, in create_window
    self.fullscreen, resizable, state)
  File "kivy/core/window/_window_sdl2.pyx", line 140, in kivy.core.window._window_sdl2._WindowSDL2Storage.setup_window (/tmp/pip-build-DtbP_O/Kivy/kivy/core/window/_window_sdl2.c:2359)
  File "kivy/core/window/_window_sdl2.pyx", line 55, in kivy.core.window._window_sdl2._WindowSDL2Storage.die (/tmp/pip-build-DtbP_O/Kivy/kivy/core/window/_window_sdl2.c:1479)

x11 - ImportError: No module named window_x11
  File "/home/richard/programmation/python/tests/kivy/kv_and_py/env/local/lib/python2.7/site-packages/kivy/core/__init__.py", line 59, in core_select_lib
    fromlist=[modulename], level=0)

[CRITICAL          ] [App         ] Unable to get a Window, abort.
################################ snip

解决

自升级以来,图形系统(OpenGL)被破坏了。所以我为我的Nvidia卡安装了正确的驱动程序,现在一切正常!

0 个答案:

没有答案