0
votes

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

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

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

2
You might get a more useful response by asking the devs or filing a bug report at github.com/kivy/kivyAzsgy

2 Answers

1
votes

This arises from a change in cython a while ago. You can avoid it by either installing kivy from the github master branch rather than pypi (there is a pip syntax for this), or by downgrading cython, possibly to 0.21.

1
votes

Python 2.7 MacOS 10.12

I was trying to install Kivy on my mac(sierra), it took me quite sometime to figure it out. Give this a shot.

Install Cython with downgraded version

pip install 'Cython===0.26.1'

From the documentation it asked you to install Cython, by

pip install -U Cython

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

Installing Kiwy by

pip install --user kivy

Without the --user flag it will throw an error saying

“OSError: [Errno 1] Operation not permitted”

Good Luck.