【问题标题】:I can't install kivy on windows 10 with py3.5我无法使用 py3.5 在 Windows 10 上安装 kivy
【发布时间】:2016-11-24 09:43:15
【问题描述】:

我无法在 Windows 10 上安装 kivy。我该怎么办?以下是错误。

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\*

【问题讨论】:

    标签: python python-3.x kivy


    【解决方案1】:

    Kivy 现在有 3.4、3.5、3.6 轮子,无需编译。见installation documentation。错误是因为您试图从 pip 安装 Kivy,现在只有 stable 版本(1.9.1),它有点旧,代码 doesn' t 在该状态下支持 py3.5 及更高版本。


    MSVC 需要一些调整和补丁。整个指令都在拉取请求中,但those 仍然是实验性的,并且需要修复指针不匹配(另一个拉取请求)。

    否则 Kivy(至少对于 py3.4 及更低版本)使用gcc。怎么编译写here

    不过,随意使用不需要编译,因为有轮子。如果您正确阅读了docs,您将了解如何安装它。

    如果你遇到Window错误,在这里搜索,已经有问题解答了。

    py3.5 甚至还有非官方的轮子。

    【讨论】:

      【解决方案2】:
      1. 安装 PIP

      2. 升级画中画

      3. 安装 Microsoft CPP 构建工具。谷歌一下,如果这个link坏了,你很容易找到。

      4. 从以下位置下载 Kivy 包 http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame你可能会遇到 “不支持轮组”的问题。只需寻找 带有/不带有 AMD 的 win32 软件包。不过,如果你继续得到 同样的错误,只需尝试下载不同的包并按照 以下步骤。带我下载了 3 个软件包以使其正确。

      5. 打开 CMD

      6. 将目录更改为下载(或软件包所在的任何位置 下载)

        pip install completePackageName.whl

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

      【讨论】:

      【解决方案3】:

      你好,我也在使用 py38 和 win10,

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

      任何人都推荐运行此命令,(它适用于我)

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

      或尝试https://www.lfd.uci.edu/~gohlke/pythonlibs/#kivy

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-07-03
        • 2020-05-16
        • 2019-02-07
        • 1970-01-01
        • 2019-12-03
        • 2019-10-11
        • 1970-01-01
        相关资源
        最近更新 更多