gpt4 book ai didi

python - 在使用 Python 3.5 或 3.6 的 Windows 上安装 Kivy 时出错

转载 作者:行者123 更新时间:2023-12-01 03:19:29 25 4
gpt4 key购买 nike

我尝试在 Python 3.6 和 3.5 上安装 Kivy 1.9.1 和 1.9.0,但都出现相同的错误。我的安装过程是:

1) Kivy 依赖项python -m pip install --升级 pipwheel setuptoolspython -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glewpython -m pip install cython==0.23

2)Visual C++ 2015 构建工具 http://landinghub.visualstudio.com/visual-cpp-build-tools

3) 基维python -m pip 安装 kivy

任何人都可以指出导致这些错误的原因以及如何协调它们吗?我看过其他关于 Kivy 错误的帖子,但找不到任何具体内容。

<小时/> 我在控制台中看到的唯一错误是这个(在安装开始时)(下面第5行和第7行):

Detected Cython version 0.23
User distribution detected, avoid portable command.
Windows platform detected, force GLEW usage.
Using this graphics system: OpenGL
WARNING: A problem occured 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 occured 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"

大约发生此错误的一半(下面第6行和第7行):

Generating code
Finished generating code
cythoning C:\Users\davidk\AppData\Local\Temp\pip-build-1_wuafui\kivy\kivy\graphics/context.pyx to C:\Users\davidk\AppData\Local\Temp\pip-build-1_wuafui\kivy\kivy\graphics\context.c
building 'kivy.graphics.context' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Python36-32\include -IC:\Python36-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /TcC:\Users\davidk\AppData\Local\Temp\pip-build-1_wuafui\kivy\kivy\graphics\context.c /Fobuild\temp.win32-3.6\Release\Users\davidk\AppData\Local\Temp\pip-build-1_wuafui\kivy\kivy\graphics\context.obj
context.c
c:\users\davidk\appdata\local\temp\pip-build-1_wuafui\kivy\kivy\graphics\gl_redirect.h(8): fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2

----------------------------------------
Failed building wheel for kivy
Running setup.py clean for kivy
Failed to build kivy
Installing collected packages: Kivy-Garden, kivy
Found existing installation: Kivy-Garden 0.1.1
Uninstalling Kivy-Garden-0.1.1:
Successfully uninstalled Kivy-Garden-0.1.1
Running setup.py install for kivy ... error
Complete output from command C:\Python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\davidk\\AppData\\Local\\Temp\\pip-build-1_wuafui\\kivy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');
f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\davidk\AppData\Local\Temp\pip-q_vg82_f-record\install-record.txt --single-version-externally-managed --compile:
Using distutils

然后(在安装结束时)(最后两行):

Generating code
Finished generating code
skipping 'C:\Users\davidk\AppData\Local\Temp\pip-build-1_wuafui\kivy\kivy\graphics\context.c' Cython extension (up-to-date)
building 'kivy.graphics.context' extension
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Python36-32\include -IC:\Python36-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /TcC:\Users\davidk\AppData\Local\Temp\pip-build-1_wuafui\kivy\kivy\graphics\context.c /Fobuild\temp.win32-3.6\Release\Users\davidk\AppData\Local\Temp\pip-build-1_wuafui\kivy\kivy\graphics\context.obj
context.c
c:\users\davidk\appdata\local\temp\pip-build-1_wuafui\kivy\kivy\graphics\gl_redirect.h(8): fatal error C1083: Cannot open include file: 'GL/glew.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2

----------------------------------------
Command "C:\Python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\davidk\\AppData\\Local\\Temp\\pip-build-1_wuafui\\kivy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\davidk\AppData\Local\Temp\pip-q_vg82_f-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\davidk\AppData\Local\Temp\pip-build-1_wuafui\kivy\

<小时/> 如果相关,控制台中列出的构建配置为:

running build_ext
Build configuration is:
* use_rpi = 0
* use_mali = 0
* use_egl = 0
* use_opengl_es2 = 0
* use_opengl_debug = 0
* use_glew = 1
* use_sdl2 = 0
* use_ios = 0
* use_mesagl = 0
* use_x11 = 0
* use_gstreamer = 0
* use_avfoundation = 0
* use_osx_frameworks = 0
* debug_gl = 0
* debug = False

最佳答案

Python 3.6 和 3.5 尚不适用于 kivy。您应该尝试使用 Python 3.4 在系统上安装 kivy。

关于python - 在使用 Python 3.5 或 3.6 的 Windows 上安装 Kivy 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42046085/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com