尝试在 Python 3.8 上安装 kivy 时出错 [重复]
Posted
技术标签:
【中文标题】尝试在 Python 3.8 上安装 kivy 时出错 [重复]【英文标题】:Error trying to install kivy on Python 3.8 [duplicate] 【发布时间】:2021-01-13 07:06:58 【问题描述】:我正在尝试安装kivy,但每次我尝试安装时都会遇到这个巨大的错误:
WARNING: A problem occurred while running pkg-config --libs --cflags sdl2 SDL2_ttf SDL2_image SDL2_mixer (code 1)
b"'pkg-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
ERROR: Dependency for context.pyx not resolved: config.pxi
ERROR: Dependency for compiler.pyx not resolved: config.pxi
ERROR: Dependency for context_instructions.pyx not resolved: config.pxi
ERROR: Dependency for fbo.pyx not resolved: config.pxi
ERROR: Dependency for gl_instructions.pyx not resolved: config.pxi
ERROR: Dependency for instructions.pyx not resolved: config.pxi
ERROR: Dependency for opengl.pyx not resolved: config.pxi
ERROR: Dependency for opengl_utils.pyx not resolved: config.pxi
ERROR: Dependency for shader.pyx not resolved: config.pxi
ERROR: Dependency for stencil_instructions.pyx not resolved: config.pxi
ERROR: Dependency for scissor_instructions.pyx not resolved: config.pxi
ERROR: Dependency for texture.pyx not resolved: config.pxi
ERROR: Dependency for vbo.pyx not resolved: config.pxi
ERROR: Dependency for vertex.pyx not resolved: config.pxi
ERROR: Dependency for vertex_instructions.pyx not resolved: config.pxi
ERROR: Dependency for cgl.pyx not resolved: config.pxi
ERROR: Dependency for cgl_mock.pyx not resolved: config.pxi
ERROR: Dependency for cgl_gl.pyx not resolved: config.pxi
ERROR: Dependency for cgl_glew.pyx not resolved: config.pxi
ERROR: Dependency for cgl_sdl2.pyx not resolved: config.pxi
ERROR: Dependency for svg.pyx not resolved: config.pxi
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
【问题讨论】:
看起来 kivy 不适用于 python 3.8,只能到 3.7。从这个页面:kivy.org/#download 【参考方案1】:https://github.com/kivy/kivy/issues/6563#issuecomment-560039155
pip install kivy[base] kivy_examples --pre --extra-index-url https://kivy.org/downloads/simple/.
【讨论】:
【参考方案2】:删除 kivvy 并尝试使用 apt 安装它
pip uninstall kivy
sudo apt install python3-kivy
其他解释可以在 kivy 的文档中找到。
【讨论】:
以上是关于尝试在 Python 3.8 上安装 kivy 时出错 [重复]的主要内容,如果未能解决你的问题,请参考以下文章
无法安装 Kivy(Windows 10,python 3.8)[重复]
安装 KIVY 时出错:为啥执行后出现错误:“python -m pip install kivy”?
如何在 Windows 上安装 pyodbc 以与 Python 3.8 一起使用?