如何在虚拟盒子里运行kivy

时间:2015-06-04 09:43:58

标签: python-3.x virtualbox kivy

HeJ小鼠

我尝试在Windows 7上的Oracle VM上玩Ubuntu 14 LTS 64Bit。安装kivy for python3工作正常。但是当我想在python中创建应用程序时,我收到了以下错误:

[[1;32mINFO[0m   ] [Logger      ] Record log in /home/stj/.kivy/logs/kivy_15-06-04_0.txt
[[1;32mINFO[0m   ] [Kivy        ] v1.9.0
[[1;32mINFO[0m   ] [Python      ] v3.4.0 (default, Apr 11 2014, 13:05:11) 
[GCC 4.8.2]
[[1;32mINFO[0m   ] [Factory     ] 173 symbols loaded
[[1;32mINFO[0m   ] [Image       ] Providers: img_tex, img_dds, img_gif, img_pil (img_pygame, img_ffpyplayer ignored)
[[1;31mCRITICAL[0m] [Window      ] Unable to find any valuable Window provider at all!
egl_rpi - ImportError: cannot import name 'bcm'
  File "/usr/local/lib/python3.4/dist-packages/kivy/core/__init__.py", line 57, in core_select_lib
    fromlist=[modulename], level=0)
  File "/usr/local/lib/python3.4/dist-packages/kivy/core/window/window_egl_rpi.py", line 12, in <module>
    from kivy.lib.vidcore_lite import bcm, egl

pygame - ImportError: No module named 'pygame'
  File "/usr/local/lib/python3.4/dist-packages/kivy/core/__init__.py", line 57, in core_select_lib
    fromlist=[modulename], level=0)
  File "/usr/local/lib/python3.4/dist-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/dist-packages/kivy/core/__init__.py", line 57, in core_select_lib
    fromlist=[modulename], level=0)

[[1;31mCRITICAL[0m] [App         ] Unable to get a Window, abort.

安装了pygame,我认为是x11窗口管理器的软件包。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

python3的pygame安装是使用以下代码来解决它的问题:

hg clone https://bitbucket.org/pygame/pygame
cd pygame
python3 setup.py build
sudo python3 setup.py install
cd ..
sudo rm -rf pygame

基于kivy installation notes