簡體   English   中英

我無法使用 py3.5 在 Windows 10 上安裝 kivy

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

我無法在 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\*

Kivy 現在有 3.4、3.5、3.6 輪子,無需編譯。 請參閱安裝文檔 錯誤是因為您試圖從 pip 安裝 Kivy,現在只有穩定版本(1.9.1),它有點舊,並且代碼在該狀態下支持 py3.5 及更高版本。


MSVC 需要一些調整和補丁。 整個指令都在拉取請求中,但那些仍然只是實驗性的,需要修復指針不匹配(另一個拉取請求)。

否則 Kivy(至少對於 py3.4 及更低版本)使用gcc 怎么編譯寫在這里

但是,對於臨時使用,您不需要編譯,因為有輪子。 如果您正確閱讀文檔,您將了解如何安裝它。

如果您遇到Window錯誤,請在此處搜索,已經有回答的問題。

在某處甚至有 py3.5 的非官方輪子。

  1. 安裝畫中畫

  2. 升級畫中畫

  3. 安裝 Microsoft CPP 構建工具。 谷歌一下,如果這個鏈接壞了,你可以很容易地找到它。

  4. http://www.lfd.uci.edu/~gohlke/pythonlibs/#pygame下載 Kivy 包您可能會遇到“不支持輪子包”的問題。 只需尋找帶有/不帶有 AMD 的帶有 win32 的軟件包。 盡管如此,如果您仍然遇到相同的錯誤,請嘗試下載不同的軟件包並按照以下步驟操作。 帶我下載了 3 個軟件包以使其正確。

  5. 打開命令

  6. 將目錄更改為下載(或下載包的任何位置)

    pip install completePackageName.whl

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

嗨,我也在使用 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM