Kivy Python 3.4 osX安装失败 [英] Kivy Python 3.4 osX installation failure
问题描述
尝试安装kivy时出现此错误.我使用了命令"pip install kivy".我已经安装了pygame和cython
I get this error when trying to install kivy. I used the command "pip install kivy". I have already installed pygame and 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'),文件,'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
Command "/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 -c "import setuptools, tokenize;file='/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'))" install --record /var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-8w_np22h-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/nd/ylp3_pwd58g73gh8vggtrc8r0000gn/T/pip-build-hcskmfya/kivy
推荐答案
Python 2.7 MacOS 10.12
Python 2.7 MacOS 10.12
我试图在我的mac(sierra)上安装Kivy,花了我相当长的时间才能弄清楚.试一试.
I was trying to install Kivy on my mac(sierra), it took me quite sometime to figure it out. Give this a shot.
使用降级版本安装Cython
Install Cython with downgraded version
pip install 'Cython===0.26.1'
它从文档中要求您安装Cython,方法是
From the documentation it asked you to install Cython, by
pip install -U Cython
但是在安装Kivy时无法编译,我在Kivy的git repo中发现,它没有使用最新版本的Cython,而是使用0.26.1版本
but it couldn't compile when installing Kivy, and I found in Kivy's git repo, it didn't use the latest version of Cython, instead if uses version 0.26.1
通过以下方式安装Kiwy:
Installing Kiwy by
pip install --user kivy
没有--user标志,它将抛出错误提示
Without the --user flag it will throw an error saying
"OSError: [Errno 1] Operation not permitted"
祝你好运.
这篇关于Kivy Python 3.4 osX安装失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!