我是python和kivy的新手,我想运行我的第一个kivy程序。当我运行程序时,我得到这个错误:
/usr/bin/python3.4 /home/mmu/PycharmProjects/ShipControl/gui/gui.py
[INFO ] [Logger ] Record log in /home/mmu/.kivy/logs/kivy_15-11-29_0.txt
[INFO ] [Kivy ] v1.9.0
[INFO ] [Python ] v3.4.3+ (default, Oct 14 2015, 16:03:50)
[GCC 5.2.1 20151010]
[INFO ] [Factory ] 173 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 "/usr/lib/python3/dist-packages/kivy/core/__init__.py", line 57, in core_select_lib
fromlist=[modulename], level=0)
File "/usr/lib/python3/dist-packages/kivy/core/window/window_egl_rpi.py", line 12, in <module>
from kivy.lib.vidcore_lite import bcm, egl
sdl2 - TypeError: expected bytes, str found
File "/usr/lib/python3/dist-packages/kivy/core/__init__.py", line 65, in core_select_lib
cls = cls()
File "/usr/lib/python3/dist-packages/kivy/core/window/window_sdl2.py", line 121, in __init__
super(WindowSDL, self).__init__()
File "/usr/lib/python3/dist-packages/kivy/core/window/__init__.py", line 616, in __init__
self.create_window()
File "/usr/lib/python3/dist-packages/kivy/core/window/window_sdl2.py", line 171, in create_window
self.fullscreen, resizable, state)
File "kivy/core/window/_window_sdl2.pyx", line 60, in kivy.core.window._window_sdl2._WindowSDL2Storage.setup_window (kivy/core/window/_window_sdl2.c:1379)
x11 - ImportError: No module named 'kivy.core.window.window_x11'
File "/usr/lib/python3/dist-packages/kivy/core/__init__.py", line 57, in core_select_lib
fromlist=[modulename], level=0)
[CRITICAL ] [App ] Unable to get a Window, abort.
Process finished with exit code 1
我已经安装了kivy使用
sudo apt-get install python3-kivy
我错过什么了吗?当我搜索这些错误时,我发现有人建议安装pygame,但这似乎是一个死项目?
6条答案
按热度按时间hujrc8aj1#
这个问题也发生在16。04为我。
我的解决方案是,删除ubuntu软件包(保存在保存一边)并使用pip安装:
xnifntxz2#
我刚从git上安装了kivy,这是我的bash_history
对于使用python3,只需将
make
替换为python3 build_ext --inplace
pip替换为pip3,然后就可以使用python3运行了j9per5c43#
正如他在评论中所说的那样,切换到kivy-daily解决了这个问题!我不得不在我的机器上做一个dist-upgrade来解决一些依赖关系。
zc0qhyus4#
我的解决方案与塞巴斯蒂安的类似,但适用于Python 2。7.
ddhy6vgd5#
判断错误е
sdl2
-TypeError: expected bytes, str found
sdl2 dependency
的安装帮助了我:sudo apt-get install python3-sdl2
li9yvcax6#
我已经安装了这里提到的每个包。..对我来说,解决的问题是导出显示(我在橙子Pi上通过VNC连接)