我无法在Windows 10上安装kivy。我该怎么办?这是错误。
C:\ WINDOWS \ system32> python -m pip install kivy 收集kivy 使用缓存的kivy-1.9.1.tar.gz 要求已经满足:Kivy-Garden> = 0.1.4在c:\ users \ kenan \ appdata \ local \ programs \ python \ python35-32 \ lib \ site-packages(来自kivy) 要求已经满足:c:\ users \ kenan \ appdata \ local \ programs \ python \ python35-32 \ lib \ site-packages中的请求(来自Kivy-Garden> = 0.1.4-> kivy) 收集包装的轮子:kivy 运行setup.py bdist_wheel for kivy ...错误 从命令C完成输出:\ Users \ kenan \ AppData \ Local \ Programs \ Python \ Python35-32 \ python.exe -u -c“import setuptools,tokenize; file ='C:\ Users \ kenan \ AppData \ Local \ Temp \ pip-build-9ojxbuh8 \ kivy \ setup.py'; f = getattr(tokenize,'open',open)( file ); code = f.read ().replace('\ r \ n','\ n'); f.close(); exec(编译(代码,文件,'exec'))“bdist_wheel -d C: \ Users \ kenan \ AppData \ Local \ Temp \ tmp86qekmsbpip-wheel- - python-tag cp35: 使用distutils
检测到Cython版本0.23 检测到用户分布,避免便携命令。 检测到Windows平台,强制使用GLEW。 使用此图形系统:OpenGL 警告:运行pkg-config时出现问题--libs --cflags gstreamer-1.0(代码1)
b“'pkg-config'不被识别为内部或外部命令,\ r \ noperable程序或批处理文件。\ r \ n”
警告:运行pkg-config时出现问题--libs --cflags sdl2 SDL2_ttf SDL2_image SDL2_mixer(代码1)
b“'pkg-config'不被识别为内部或外部命令,\ r \ noperable程序或批处理文件。\ r \ n”
构建配置是: * 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
检测到的编译器是msvc
C:\ Program Files \ Microsoft Visual Studio 14.0 \ VC \ BIN \ cl.exe / c / nologo / Ox / W3 / GL / DNDEBUG / MD -IC:\ Users \ kenan \ AppData \ Local \ Programs \ Python \ Python35-32 \ include -IC:\ Users \ kenan \ AppData \ Local \ Programs \ Python \ Python35-32 \ include“-IC:\ Program Files \ Microsoft Visual Studio 14.0 \ VC \ INCLUDE”“ - IC:\ Program Files \ Microsoft Visual Studio 14.0 \ VC \ ATLMFC \ INCLUDE“” - IC:\ Program Files \ Windows Kits \ 10 \ include \ 10.0.10240.0 \ ucrt“” - IC:\ Program Files \ Windows Kits \ NETFXSDK \ 4.6.1 \ include \ um“” - IC:\ Program Files \ Windows Kits \ 10 \ include \ 10.0.10240.0 \ shared“” - IC:\ Program Files \ Windows Kits \ 10 \ include \ 10.0.10240.0 \ um“” - IC :\ Program Files \ Windows Kits \ 10 \ include \ 10.0.10240.0 \ winrt“/TcC:\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\kivy\graphics\vertex_instructions.c / Fobuild \ temp.win32-3.5 \发布\用户\凯南\应用程序数据\本地的\ Temp \ PIP-集结9ojxbuh8 \ kivy \ kivy \图形\ vertex_instructions.obj vertex_instructions.c c:\ users \ kenan \ appdata \ local \ temp \ pip-build-9ojxbuh8 \ kivy \ kivy \ graphics \ gl_redirect.h(8):致命错误C1083:无法打开包含文件:'GL / glew.h':否这样的文件或目录 错误:命令'C:\ Program Files \ Microsoft Visual Studio 14.0 \ VC \ BIN \ cl.exe'失败,退出状态为2
为kivy构建车轮失败 运行setup.py清理为kivy 无法建立kivy 安装收集的软件包:kivy 运行setup.py安装kivy ...错误 从命令C完成输出:\ Users \ kenan \ AppData \ Local \ Programs \ Python \ Python35-32 \ python.exe -u -c“import setuptools,tokenize; file ='C:\ Users \ kenan \ AppData \ Local \ Temp \ pip-build-9ojxbuh8 \ kivy \ setup.py'; f = getattr(tokenize,'open',open)( file ); code = f.read ().replace('\ r \ n','\ n'); f.close(); exec(编译(代码,文件,'exec'))“install --record C :\ Users \ kenan \ AppData \ Local \ Temp \ pip-9ucs7wug-record \ install-record.txt --single-version-external-managed --compile: 使用distutils
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"
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
Detected compiler is msvc
cythoning C:\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\kivy\graphics/vbo.pyx to C:\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\kivy\graphics\vbo.c
building 'kivy.graphics.vbo' extension
creating build\temp.win32-3.5
creating build\temp.win32-3.5\Release
creating build\temp.win32-3.5\Release\Users
creating build\temp.win32-3.5\Release\Users\kenan
creating build\temp.win32-3.5\Release\Users\kenan\AppData
creating build\temp.win32-3.5\Release\Users\kenan\AppData\Local
creating build\temp.win32-3.5\Release\Users\kenan\AppData\Local\Temp
creating build\temp.win32-3.5\Release\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8
creating build\temp.win32-3.5\Release\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy
creating build\temp.win32-3.5\Release\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\kivy
creating build\temp.win32-3.5\Release\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\kivy\graphics
C:\Program Files\Microsoft Visual Studio 14.0\VC\BIN\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\kenan\AppData\Local\Programs\Python\Python35-32\include -IC:\Users\kenan\AppData\Local\Programs\Python\Python35-32\include "-IC:\Program Files\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files\Windows Kits\10\include\10.0.10240.0\ucrt" "-IC:\Program Files\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files\Windows Kits\10\include\10.0.10240.0\shared" "-IC:\Program Files\Windows Kits\10\include\10.0.10240.0\um" "-IC:\Program Files\Windows Kits\10\include\10.0.10240.0\winrt" /TcC:\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\kivy\graphics\vbo.c /Fobuild\temp.win32-3.5\Release\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\kivy\graphics\vbo.obj
vbo.c
c:\users\kenan\appdata\local\temp\pip-build-9ojxbuh8\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\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2
----------------------------------------
命令“C:\ Users \ kenan \ AppData \ Local \ Programs \ Python \ Python35-32 \ python.exe -u -c”import setuptools,tokenize; file ='C:\用户\ kenan \ AppData \ Local \ Temp \ pip-build-9ojxbuh8 \ kivy \ setup.py'; f = getattr(tokenize,'open',open)( file ); code = f。 read()。replace('\ r \ n','\ n'); f.close(); exec(编译(代码,文件,'exec'))“install --record C:\ Users \ kenan \ AppData \ Local \ Temp \ pip-9ucs7wug-record \ install-record.txt --single-version-external-managed --compile“在C:\ Users \ kenan \中失败,错误代码为1应用程序数据\本地\ TEMP \ PIP-集结9ojxbuh8 \ kivy **
答案 0 :(得分:0)
Kivy现在拥有3.4,3.5,3.6个轮子,无需编译。见installation documentation。错误是因为你试图从pip安装Kivy,现在只有稳定版本(1.9.1),这有点旧,代码 没有&# 39; t 在该状态下支持py3.5及更高版本。
MSVC需要一些调整和补丁。整个说明都在拉取请求中,但those仍然是实验性的 ,并且需要修复指针不匹配(另一个拉取请求)。
否则Kivy(至少对于py3.4及更低版本)使用gcc
。如何编译写成here
然而,对于临时使用,你不需要编译,因为有轮子。如果您正确阅读了docs,那么您将了解如何安装它。
如果您遇到Window
错误,请在此处搜索,已经回答了问题。
在某处,py3.5甚至还有非官方的轮子。
答案 1 :(得分:0)
安装PIP
升级PIP
安装Microsoft CPP BUILD工具: http://landinghub.visualstudio.com/visual-cpp-build-tools
从http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame下载Kivy套餐 您可能会遇到“不支持Wheel包”的问题。只需查看带有/不带AMD的win32包。尽管如此,如果您仍然遇到相同的错误,请尝试下载不同的包并按照以下步骤操作。我已经下载3个软件包了。
打开CMD
将目录更改为下载(或者下载软件包的任何地方)
执行pip install completePackageName.whl
例如:C:\Users\UserName\Downloads>pip install Kivy-1.9.1+sdl2-cp35-cp35m-win32.whl
答案 2 :(得分:0)
嗨,我也使用py38和win10,
选中此https://github.com/kivy/kivy/issues/6563
任何人都建议运行此命令(对我有用)
pip install kivy[base] kivy_examples --pre --extra-index-url https://kivy.org/downloads/simple/