简体   繁体   English

我无法使用 py3.5 在 Windows 10 上安装 kivy

[英]I can't install kivy on windows 10 with py3.5

I can't install kivy on windows 10. What can i do?我无法在 Windows 10 上安装 kivy。我该怎么办? Here are errors.这里有错误。

C:\WINDOWS\system32>python -m pip install kivy
Collecting kivy
  Using cached kivy-1.9.1.tar.gz
Requirement already satisfied: Kivy-Garden>=0.1.4 in c:\users\kenan\appdata\local\programs\python\python35-32\lib\site-packages (from kivy)
Requirement already satisfied: requests in c:\users\kenan\appdata\local\programs\python\python35-32\lib\site-packages (from Kivy-Garden>=0.1.4->kivy)
Building wheels for collected packages: kivy
  Running setup.py bdist_wheel for kivy ... error
  Complete output from command 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(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\kenan\AppData\Local\Temp\tmp86qekmsbpip-wheel- --python-tag cp35:
  Using 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

  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\Release\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\kivy\graphics\vertex_instructions.obj
  vertex_instructions.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

  ----------------------------------------
  Failed building wheel for kivy
  Running setup.py clean for kivy
Failed to build kivy
Installing collected packages: kivy
  Running setup.py install for kivy ... error
    Complete output from command 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(compile(code, __file__, 'exec'))" install --record C:\Users\kenan\AppData\Local\Temp\pip-9ucs7wug-record\install-record.txt --single-version-externally-managed --compile:
    Using 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

    ----------------------------------------
Command "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(compile(code, __file__, 'exec'))" install --record C:\Users\kenan\AppData\Local\Temp\pip-9ucs7wug-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\kenan\AppData\Local\Temp\pip-build-9ojxbuh8\kivy\*

Kivy now has 3.4, 3.5, 3.6 wheels, no compilation necessary. Kivy 现在有 3.4、3.5、3.6 轮子,无需编译。 See installation documentation .请参阅安装文档 The error is because you were trying to install Kivy from pip, where is only the stable version now (1.9.1), which is a little bit old and the code doesn't support py3.5 and higher in that state.错误是因为您试图从 pip 安装 Kivy,现在只有稳定版本(1.9.1),它有点旧,并且代码在该状态下支持 py3.5 及更高版本。


MSVC needs a little bit of tweaking and patches. MSVC 需要一些调整和补丁。 The whole instructions are in pull requests, but those are still experimental only and there's a need to fix a pointer mismatch (another pull request).整个指令都在拉取请求中,但那些仍然只是实验性的,需要修复指针不匹配(另一个拉取请求)。

Otherwise Kivy (at least for py3.4 and lower) uses gcc .否则 Kivy(至少对于 py3.4 及更低版本)使用gcc How to compile is written here怎么编译写在这里

However, for casual usage you don't need to compile, because there are wheels.但是,对于临时使用,您不需要编译,因为有轮子。 If you read the docs properly, you'll find out how to install it.如果您正确阅读文档,您将了解如何安装它。

If you encounter Window error, search here, there are already answered questions.如果您遇到Window错误,请在此处搜索,已经有回答的问题。

There are even unofficial wheels for py3.5 somewhere.在某处甚至有 py3.5 的非官方轮子。

  1. Install PIP安装画中画

  2. Upgrade PIP升级画中画

  3. Install Microsoft CPP BUILD TOOLS.安装 Microsoft CPP 构建工具。 Google it, you can find it easily if this link is broken.谷歌一下,如果这个链接坏了,你可以很容易地找到它。

  4. Download Kivy Package from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame You might face issues of "Wheel package is not supported".http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame下载 Kivy 包您可能会遇到“不支持轮子包”的问题。 Just look for the package with win32 with/without AMD.只需寻找带有/不带有 AMD 的带有 win32 的软件包。 Still, if you keep getting the same error, Just try downloading the different package and follow the following steps.尽管如此,如果您仍然遇到相同的错误,请尝试下载不同的软件包并按照以下步骤操作。 Took me to download 3 Packages to get it right.带我下载了 3 个软件包以使其正确。

  5. Open CMD打开命令

  6. Change Directory to Downloads (Or wherever the package is downloaded)将目录更改为下载(或下载包的任何位置)

    Do pip install completePackageName.whl pip install completePackageName.whl

    Ex: C:\\Users\\UserName\\Downloads>pip install Kivy-1.9.1+sdl2-cp35-cp35m-win32.whl例如: C:\\Users\\UserName\\Downloads>pip install Kivy-1.9.1+sdl2-cp35-cp35m-win32.whl

Hi im using py38 and win10 too,嗨,我也在使用 py38 和 win10,

check this https://github.com/kivy/kivy/issues/6563检查这个https://github.com/kivy/kivy/issues/6563

Anyone recommend run this command, (it works for me)任何人都建议运行此命令,(它对我有用)

pip install kivy[base] kivy_examples --pre --extra-index-url https://kivy.org/downloads/simple/

or try with https://www.lfd.uci.edu/~gohlke/pythonlibs/#kivy或尝试使用https://www.lfd.uci.edu/~gohlke/pythonlibs/#kivy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM