无法安装 Kivy(Windows 10,python 3.8)[重复]
Posted
技术标签:
【中文标题】无法安装 Kivy(Windows 10,python 3.8)[重复]【英文标题】:Cannot install Kivy (windows 10, python 3.8) [duplicate] 【发布时间】:2020-07-03 10:08:38 【问题描述】:在我的系统上安装 kivy 时遇到很多麻烦。我以前做过这个工作,但由于某种原因,我现在过得很艰难。 我按照指示逐字执行,设置 virtualenv,激活 env,安装依赖项(docutils、pygments、pypiwin32、kivy_deps.sdl2==0.1*.、kivy_deps.glew==0.1*.、kivy_deps.gstreamer==0.1。 *)。
上面的所有部分都可以正常工作。当我终于去安装 kivy (py -m pip install kivy) 时,我得到了一连串的错误:
ERROR: Command errored out with exit status 1:
command: 'C:\Users\ferna\Documents\Python\pyenv3864\Scripts\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\ferna\\AppData\\Local\\Temp\\pip-install-ctrp6hf9\\kivy\\setup.py'"'"'; __file__='"'"'C:\\Users\\ferna\\AppData\\Local\\Temp\\pip-install-ctrp6hf9\\kivy\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info
--egg-base 'C:\Users\ferna\AppData\Local\Temp\pip-install-ctrp6hf9\kivy\pip-egg-info'
cwd: C:\Users\ferna\AppData\Local\Temp\pip-install-ctrp6hf9\kivy\
Complete output (79 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ferna\AppData\Local\Temp\pip-install-ctrp6hf9\kivy\setup.py", line 1073, in <module>
setup(
File "C:\Users\ferna\Documents\Python\pyenv3864\lib\site-packages\setuptools\__init__.py", line 144, in setup
_install_setup_requires(attrs)
File "C:\Users\ferna\Documents\Python\pyenv3864\lib\site-packages\setuptools\__init__.py", line 139, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "C:\Users\ferna\Documents\Python\pyenv3864\lib\site-packages\setuptools\dist.py", line 716, in fetch_build_eggs
resolved_dists = pkg_resources.working_set.resolve(
File "C:\Users\ferna\Documents\Python\pyenv3864\lib\site-packages\pkg_resources\__init__.py", line 780, in resolve
dist = best[req.key] = env.best_match(
File "C:\Users\ferna\Documents\Python\pyenv3864\lib\site-packages\pkg_resources\__init__.py", line 1065, in best_match
return self.obtain(req, installer)
File "C:\Users\ferna\Documents\Python\pyenv3864\lib\site-packages\pkg_resources\__init__.py", line 1077, in obtain
return installer(requirement)
File "C:\Users\ferna\Documents\Python\pyenv3864\lib\site-packages\setuptools\dist.py", line 786, in fetch_build_egg
return cmd.easy_install(req)
File "C:\Users\ferna\Documents\Python\pyenv3864\lib\site-packages\setuptools\command\easy_install.py", line 665, in easy_install
dist = self.package_index.fetch_distribution(
File "C:\Users\ferna\Documents\Python\pyenv3864\lib\site-packages\setuptools\package_index.py", line 655, in fetch_distribution
dist = find(requirement)
File "C:\Users\ferna\Documents\Python\pyenv3864\lib\site-packages\setuptools\package_index.py", line 635, in find
loc = self.download(dist.location, tmpdir)
File "C:\Users\ferna\Documents\Python\pyenv3864\lib\site-packages\setuptools\package_index.py", line 579, in download
found = self._download_url(scheme.group(1), spec, tmpdir)
File "C:\Users\ferna\Documents\Python\pyenv3864\lib\site-packages\setuptools\package_index.py", line 824, in _download_url
return self._attempt_download(url, filename)
File "C:\Users\ferna\Documents\Python\pyenv3864\lib\site-packages\setuptools\package_index.py", line 830, in _attempt_download
headers = self._download_to(url, filename)
File "C:\Users\ferna\Documents\Python\pyenv3864\lib\site-packages\setuptools\package_index.py", line 745, in _download_to
block = fp.read(bs)
File "C:\Users\ferna\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 454, in read
n = self.readinto(b)
File "C:\Users\ferna\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 498, in readinto
n = self.fp.readinto(b)
File "C:\Users\ferna\AppData\Local\Programs\Python\Python38\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "C:\Users\ferna\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "C:\Users\ferna\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
Using setuptools
User distribution detected, avoid portable command.
Using this graphics system: OpenGL
WARNING: A problem occurred while running pkg-config --libs --cflags gstreamer-1.0 (code 1)
b"'pkg-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
WARNING: A problem occurred while running pkg-config --libs --cflags gstreamer-1.0 (code 1)
b"'pkg-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
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: conf ERROR: Dependency for vertex_instructions.pyx not resolved: config.pxi xi
ERROR: Dependency for cgl.pyx not resolved: config.pxi
ERROR: Dependency for cgl_mock.pyx not resolved: config.i pxi ed: config.pxi
ERROR: Dependency for cgl_gl.pyx not resolved: config.pxi
ERROR: Dependency for cgl_glew.pyx not resolved: config.pxi pxi i
ERROR: Dependency for cgl_sdl2.pyx not resolved: config.pxi pxi pxi
ERROR: Dependency for svg.pyx not resolved: config.pxi
---------------------------------------- fo Check the logs for full command output.
ERROR: Command errored out with exit status 1: python setup.py egg_inpy egg_info Check the logs for full command output.
我也尝试过使用夜间备份,安装***,尝试 tar.gz;但我在这里很困惑。
【问题讨论】:
我认为 Kivy 还不支持 Python 3.8。它的 PyPI 项目页面 pypi.org/project/Kivy 和它的 Windows 安装说明 kivy.org/doc/stable/installation/installation-windows.html 都说不。 -__- 真是个疏忽。 - 所以当一个包被标记为“cp38”时,这是否意味着它与 python 3.8 的兼容性?我想这个命名法让我相信 3.8 是稳定的 kivy.org/downloads/appveyor/kivy 我不是 Kivy 专家,所以我对命名法无话可说。但是你的问题说它曾经可以工作,这在我脑海中敲响了升级警报。 【参考方案1】:我们目前不为 Windows 上 Python 3.8 下的最新 Kivy 稳定版本提供***。您的选择是:
设置工作编译器工具链并自己编译 Kivy 使用 Python 3.7 使用 Kivy master 分支,它确实有 Python 3.8 ***可用 - 我不记得是怎么知道的,但最坏的情况是 Kivy discord 上的某个人会知道请注意,最新的 Kivy 稳定版本确实支持 Python 3.8,它运行良好,这就是第一个选项可用的原因。问题完全在于缺少预构建的二进制文件。
【讨论】:
【参考方案2】:easy_install kivy
有效(但 easy_install 已弃用,所以要小心)
【讨论】:
以上是关于无法安装 Kivy(Windows 10,python 3.8)[重复]的主要内容,如果未能解决你的问题,请参考以下文章
Kivy 错误,[CRITICAL] [Text] 无法找到任何有价值的文本提供程序(python 3.6.1)(windows 10)