2017-03-28 145 views
0

我試圖在我的Windows 7 PC上安裝Kivy,以便使用python進行Android開發。使用Anaconda Python 3.6在Windows 7上安裝Kivy

我按照這裏提到的步驟。 kivy installation on Windows

我收到了

python -m pip install kivy

第一個錯誤以下錯誤

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\OEM\Anaconda3\libs /LIBPATH:C:\Users\OEM\Anaconda3\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10586.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10586.0\um\x64" /EXPORT:PyInit_buffer build\temp.win-amd64-3.6\Release\Users\OEM\AppData\Local\Temp\pip-build-jmayz55y\kivy\kivy\graphics\buffer.obj /OUT:build\lib.win-amd64-3.6\kivy\graphics\buffer.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\Users\OEM\AppData\Local\Temp\pip-build-jmayz55y\kivy\kivy\graphics\buffer.cp36-win_amd64.lib 
    buffer.obj : warning LNK4197: export 'PyInit_buffer' specified multiple times; using first specification 
    Creating library build\temp.win-amd64-3.6\Release\Users\OEM\AppData\Local\Temp\pip-build-jmayz55y\kivy\kivy\graphics\buffer.cp36-win_amd64.lib and object build\temp.win-amd64-3.6\Release\Users\OEM\AppData\Local\Temp\pip-build-jmayz55y\kivy\kivy\graphics\buffer.cp36-win_amd64.exp 
    Generating code 
    Finished generating code 
    cythoning C:\Users\OEM\AppData\Local\Temp\pip-build-jmayz55y\kivy\kivy\graphics/context.pyx to C:\Users\OEM\AppData\Local\Temp\pip-build-jmayz55y\kivy\kivy\graphics\context.c 
    building 'kivy.graphics.context' extension 
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\OEM\Anaconda3\include -IC:\Users\OEM\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\winrt" /TcC:\Users\OEM\AppData\Local\Temp\pip-build-jmayz55y\kivy\kivy\graphics\context.c /Fobuild\temp.win-amd64-3.6\Release\Users\OEM\AppData\Local\Temp\pip-build-jmayz55y\kivy\kivy\graphics\context.obj 
    context.c 
    c:\users\oem\appdata\local\temp\pip-build-jmayz55y\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\\x86_amd64\\cl.exe' failed with exit status 2 

    ---------------------------------------- 
    Running setup.py clean for kivy 
Failed to build kivy 
Installing collected packages: kivy 
    Running setup.py install for kivy: started 
    Running setup.py install for kivy: finished with status 'error' 
    Complete output from command C:\Users\OEM\Anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\OEM\\AppData\\Local\\Temp\\pip-build-jmayz55y\\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\OEM\AppData\Local\Temp\pip-wg_pau0w-record\install-record.txt --single-version-externally-managed --compile: 
    Using distutils 

    Detected Cython version 0.25.2 
     This version of Cython is untested with Kivy. While this version may 
     work perfectly fine, it is possible that you may experience issues. If 
     you do have issues, please downgrade to a supported version. It is 
     best to use the newest supported version, 0.23, but the minimum 
     supported version is 0.20. 

     If your platform provides a Cython package, check if you can downgrade 
     to a supported version. Otherwise, uninstall the platform package and 
     install Cython via pip: 

     pip install -I Cython==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" 

第二個錯誤:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:C:\Users\OEM\Anaconda3\libs /LIBPATH:C:\Users\OEM\Anaconda3\PCbuild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10586.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\10\lib\10.0.10586.0\um\x64" /EXPORT:PyInit_buffer build\temp.win-amd64-3.6\Release\Users\OEM\AppData\Local\Temp\pip-build-jmayz55y\kivy\kivy\graphics\buffer.obj /OUT:build\lib.win-amd64-3.6\kivy\graphics\buffer.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\Users\OEM\AppData\Local\Temp\pip-build-jmayz55y\kivy\kivy\graphics\buffer.cp36-win_amd64.lib 
    buffer.obj : warning LNK4197: export 'PyInit_buffer' specified multiple times; using first specification 
     Creating library build\temp.win-amd64-3.6\Release\Users\OEM\AppData\Local\Temp\pip-build-jmayz55y\kivy\kivy\graphics\buffer.cp36-win_amd64.lib and object build\temp.win-amd64-3.6\Release\Users\OEM\AppData\Local\Temp\pip-build-jmayz55y\kivy\kivy\graphics\buffer.cp36-win_amd64.exp 
    Generating code 
    Finished generating code 
    skipping 'C:\Users\OEM\AppData\Local\Temp\pip-build-jmayz55y\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\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\OEM\Anaconda3\include -IC:\Users\OEM\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\include\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10586.0\winrt" /TcC:\Users\OEM\AppData\Local\Temp\pip-build-jmayz55y\kivy\kivy\graphics\context.c /Fobuild\temp.win-amd64-3.6\Release\Users\OEM\AppData\Local\Temp\pip-build-jmayz55y\kivy\kivy\graphics\context.obj 
    context.c 
    c:\users\oem\appdata\local\temp\pip-build-jmayz55y\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\\x86_amd64\\cl.exe' failed with exit status 2 

    ---------------------------------------- 

有什麼不對的安裝?

回答

1

從您的第一個錯誤消息,您的cython版本可能是罪魁禍首。根據kivy文檔:

This version of Kivy requires at least Cython version 0.23, and has been tested through 0.23. Later versions may work, but as they have not been tested there is no guarantee.

在安裝kivy之前,請嘗試安裝特定的cython版本0.23。

pip install cython==0.23 

然後重複安裝kivy。

+0

不,不是。不在這裏。 Kivy版本更重要。 – KeyWeeUsr

0

Py35 +支持僅在最近才添加,因此Kivy 1.9.1版本(即在pypi上)不能在py35 +上運行。

要使其工作編譯無論是從來源:

pip install https://github.com/kivy/kivy/zipball/master 

或使用輪子是完全一樣的文檔頁面上。