簡體   English   中英

Kivy Python 3.4 osX安裝失敗

[英]Kivy Python 3.4 osX installation failure

嘗試安裝kivy時出現此錯誤。 我使用了命令“ pip install kivy”。 我已經安裝了pygame和cython

5 warnings generated.
/usr/bin/clang -bundle -undefined dynamic_lookup -g build/temp.macosx-10.6-intel-3.4/private/var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-build-hcskmfya/kivy/kivy/graphics/vertex_instructions.o -o build/lib.macosx-10.6-intel-3.4/kivy/graphics/vertex_instructions.so -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks -framework OpenGL -arch x86_64 -lm
cythoning /private/var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-build-hcskmfya/kivy/kivy/graphics/context.pyx to /private/var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-build-hcskmfya/kivy/kivy/graphics/context.c
building 'kivy.graphics.context' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -g -I/Library/Frameworks/Python.framework/Versions/3.4/include/python3.4m -c /private/var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-build-hcskmfya/kivy/kivy/graphics/context.c -o build/temp.macosx-10.6-intel-3.4/private/var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-build-hcskmfya/kivy/kivy/graphics/context.o -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks -arch x86_64
/private/var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-build-hcskmfya/kivy/kivy/graphics/context.c:1:2: error: Do not use this file, it is the result of a failed Cython compilation.
#error Do not use this file, it is the result of a failed Cython compilation.
 ^
1 error generated.

 Error compiling Cython file:
 ------------------------------------------------------------
 ...
     cpdef release(self)
     cpdef get_pixel_color(self, int wx, int wy)

     cdef void create_fbo(self)
     cdef void delete_fbo(self)
     cdef void apply(self)
                   ^
 ------------------------------------------------------------

 kivy/graphics/fbo.pxd:27:19: Signature not compatible with previous declaration

 Error compiling Cython file:
 ------------------------------------------------------------
 ...
     cdef void push_states(self, list names) except *
     cdef void pop_state(self, str name) except *
     cdef void pop_states(self, list names) except *
     cdef void enter(self) except *
     cdef void leave(self) except *
     cdef void apply(self) except *
                   ^
 ------------------------------------------------------------

 kivy/graphics/instructions.pxd:123:19: Previous declaration is here
 error: command '/usr/bin/clang' failed with exit status 1

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

命令“ /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 -c”導入設置工具,標記化; 文件 ='/ private / var / folders / nd / ylp3_pwd58g73gh8vggtrc8r0000gn / T / pip-build-hcskmfya / kivy / setup.py'; exec(compile(getattr(tokenize,'open',open)( file ).read() .replace('\\ r \\ n','\\ n'), file ,'exec'))“安裝--record /var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-8w_np22h-record/install-record.txt --single-version-externally-managed --compile“在/ private / var / folders / nd / ylp3_pwd58g73gh8vggtrc8r0000gn / T / pip-build-hcskmfya / kivy中失敗,錯誤代碼為1

這是由於前段Cython的變化引起的。 您可以通過從github master分支而不是pypi安裝kivy(有pip語法)或將cython降級到0.21來避免這種情況。

Python 2.7 MacOS 10.12

我試圖在Mac(Sierra)上安裝Kivy,花了相當長的時間才弄清楚。 試一下。

使用降級版本安裝Cython

pip install 'Cython===0.26.1'

從要求您安裝Cython的文檔中,

pip install -U Cython

但是在安裝Kivy時無法編譯,而且我在Kivy的git repo中發現,它沒有使用最新版本的Cython,而是使用0.26.1版

通過安裝Kiwy

pip install --user kivy

如果沒有--user標志,它將拋出錯誤提示

“OSError: [Errno 1] Operation not permitted”

祝好運。

暫無
暫無

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

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