Kivy: macOS 10.13 Python2.7.10 Install kivy error via pip

Created on 4 Nov 2017  路  9Comments  路  Source: kivy/kivy

Versions

  • Python:2.7.10
  • OS: macOS 10.13 High Sierra
  • Kivy: N/A
  • Kivy installation method: sudo pip install kivy

Description

Attempting to install Kivy using the pip method. I have successfully installed Cython and the other pre-requisites via Homebrew.
I receive the below error upon entering "sudo pip install kivy"

Code and Logs

Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-lzJfp5/kivy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-lPcVuX-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-lzJfp5/kivy/

Most helpful comment

@parabolize I'm not a mac user, but it looks like a permission issue to me because of the log below:

...
    running install_data
    creating /System/Library/Frameworks/Python.framework/Versions/2.7/share
     error: could not create '/System/Library/Frameworks/Python.framework/Versions/2.7/share': Operation not permitted
error
...

So you could try to add the --user flag to your pip install.

pip install --user --verbose https://github.com/kivy/kivy/zipball/master

All 9 comments

馃憢 Thanks for opening your first issue here! Be sure to follow the issue template!

@krauseling Hi, please run pip install with --verbose. This output is very generic and not useful at all.

@KeyWeeUsr, thanks for the reply. Here is a more verbose output but not all of it due to max length.

cythoning /private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.pyx to /private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c
building 'kivy.graphics.vertex_instructions' extension
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -arch x86_64 -I/private/tmp/pip-build-ZqJR8f/kivy/kivy/include -I/private/tmp/pip-build-ZqJR8f/kivy/kivy/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c /private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c -o build/temp.macosx-10.13-intel-2.7/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.o -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks
In file included from /private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c:242:
In file included from /private/tmp/pip-build-ZqJR8f/kivy/kivy/include/gl_redirect.h:53:
/private/tmp/pip-build-ZqJR8f/kivy/kivy/include/common_subset.h:461:9: warning: 'GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS' macro redefined [-Wmacro-redefined]
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT
        ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/include/gl_redirect.h:30:9: note: previous definition is here
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS        0x8CD9
        ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c:16906:15: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
  __pyx_v_l = __pyx_t_2;
            ~ ^~~~~~~~~
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c:55505:32: warning: unused function '__Pyx_PyUnicode_FromString' [-Wunused-function]
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
                               ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c:332:29: warning: unused function '__Pyx_Py_UNICODE_strlen' [-Wunused-function]
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
                            ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c:55682:33: warning: unused function '__Pyx_PyInt_FromSize_t' [-Wunused-function]
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
                                ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c:51864:26: warning: unused function '__Pyx_GetBufferAndValidate' [-Wunused-function]
static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
                         ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c:51898:27: warning: unused function '__Pyx_SafeReleaseBuffer' [-Wunused-function]
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
                          ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c:51970:1: warning: unused function '__pyx_add_acquisition_count_locked' [-Wunused-function]
__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c:51980:1: warning: unused function '__pyx_sub_acquisition_count_locked' [-Wunused-function]
__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c:4354:26: warning: unused function 'resize' [-Wunused-function]
static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) {
                         ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c:54458:32: warning: unused function '__Pyx_PyInt_From_unsigned_long' [-Wunused-function]
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) {
                               ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c:54829:27: warning: function '__Pyx_PyInt_As_char' is not needed and will not be emitted [-Wunneeded-internal-declaration]
static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
                          ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c:35183:35: warning: unused function '__pyx_f_7cpython_5array_copy' [-Wunused-function]
static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) {
                                  ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c:35337:26: warning: unused function '__pyx_f_7cpython_5array_extend' [-Wunused-function]
static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) {
                         ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.c:35411:27: warning: unused function '__pyx_f_7cpython_5array_zero' [-Wunused-function]
static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) {
                          ^
15 warnings generated.
cc -bundle -undefined dynamic_lookup -Wl,-F. -arch x86_64 build/temp.macosx-10.13-intel-2.7/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/vertex_instructions.o -o build/lib.macosx-10.13-intel-2.7/kivy/graphics/vertex_instructions.so -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks -lm
cythoning /private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.pyx to /private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c
building 'kivy.graphics.texture' extension
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -arch x86_64 -I/private/tmp/pip-build-ZqJR8f/kivy/kivy/include -I/private/tmp/pip-build-ZqJR8f/kivy/kivy/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c /private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c -o build/temp.macosx-10.13-intel-2.7/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.o -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks
In file included from /private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c:242:
In file included from /private/tmp/pip-build-ZqJR8f/kivy/kivy/include/gl_redirect.h:53:
/private/tmp/pip-build-ZqJR8f/kivy/kivy/include/common_subset.h:461:9: warning: 'GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS' macro redefined [-Wmacro-redefined]
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT
        ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/include/gl_redirect.h:30:9: note: previous definition is here
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS        0x8CD9
        ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c:5152:24: warning: implicit conversion loses integer precision: 'Py_ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
    __pyx_v_datasize = __pyx_t_7;
                     ~ ^~~~~~~~~
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c:38248:32: warning: unused function '__Pyx_PyUnicode_FromString' [-Wunused-function]
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
                               ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c:332:29: warning: unused function '__Pyx_Py_UNICODE_strlen' [-Wunused-function]
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
                            ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c:34975:26: warning: unused function '__Pyx_GetBufferAndValidate' [-Wunused-function]
static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
                         ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c:35009:27: warning: unused function '__Pyx_SafeReleaseBuffer' [-Wunused-function]
static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
                          ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c:35081:1: warning: unused function '__pyx_add_acquisition_count_locked' [-Wunused-function]
__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c:35091:1: warning: unused function '__pyx_sub_acquisition_count_locked' [-Wunused-function]
__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c:35640:32: warning: unused function '__Pyx_PyTuple_GetSlice' [-Wunused-function]
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
                               ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c:35670:32: warning: unused function '__Pyx_GetItemInt_List_Fast' [-Wunused-function]
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                               ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c:35685:32: warning: unused function '__Pyx_GetItemInt_Tuple_Fast' [-Wunused-function]
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                               ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c:3946:26: warning: unused function 'resize' [-Wunused-function]
static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) {
                         ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c:7182:26: warning: unused function '__pyx_f_4kivy_8graphics_7texture__is_gl_format_supported' [-Wunused-function]
static CYTHON_INLINE int __pyx_f_4kivy_8graphics_7texture__is_gl_format_supported(PyObject *__pyx_v_x) {
                         ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c:19255:35: warning: unused function '__pyx_f_7cpython_5array_copy' [-Wunused-function]
static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) {
                                  ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c:19409:26: warning: unused function '__pyx_f_7cpython_5array_extend' [-Wunused-function]
static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) {
                         ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.c:19483:27: warning: unused function '__pyx_f_7cpython_5array_zero' [-Wunused-function]
static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) {
                          ^
16 warnings generated.
cc -bundle -undefined dynamic_lookup -Wl,-F. -arch x86_64 build/temp.macosx-10.13-intel-2.7/private/tmp/pip-build-ZqJR8f/kivy/kivy/graphics/texture.o -o build/lib.macosx-10.13-intel-2.7/kivy/graphics/texture.so -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks -lm
cythoning /private/tmp/pip-build-ZqJR8f/kivy/kivy/core/audio/audio_sdl2.pyx to /private/tmp/pip-build-ZqJR8f/kivy/kivy/core/audio/audio_sdl2.c
building 'kivy.core.audio.audio_sdl2' extension
creating build/temp.macosx-10.13-intel-2.7/private/tmp/pip-build-ZqJR8f/kivy/kivy/core/audio
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -arch x86_64 -I/private/tmp/pip-build-ZqJR8f/kivy/kivy/include -I/usr/local/include/SDL2 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c /private/tmp/pip-build-ZqJR8f/kivy/kivy/core/audio/audio_sdl2.c -o build/temp.macosx-10.13-intel-2.7/private/tmp/pip-build-ZqJR8f/kivy/kivy/core/audio/audio_sdl2.o -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks
/private/tmp/pip-build-ZqJR8f/kivy/kivy/core/audio/audio_sdl2.c:1374:63: error: use of undeclared identifier 'MIX_INIT_MODPLUG'; did you mean 'MIX_INIT_MOD'?
  __pyx_v_want_flags = (__pyx_v_want_flags | ((MIX_INIT_MOD | MIX_INIT_MODPLUG) | MIX_INIT_FLUIDSYNTH));
                                                              ^~~~~~~~~~~~~~~~
                                                              MIX_INIT_MOD
/usr/local/include/SDL2/SDL_mixer.h:80:5: note: 'MIX_INIT_MOD' declared here
    MIX_INIT_MOD    = 0x00000002,
    ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/core/audio/audio_sdl2.c:1374:83: error: use of undeclared identifier 'MIX_INIT_FLUIDSYNTH'
  __pyx_v_want_flags = (__pyx_v_want_flags | ((MIX_INIT_MOD | MIX_INIT_MODPLUG) | MIX_INIT_FLUIDSYNTH));
                                                                                  ^
/private/tmp/pip-build-ZqJR8f/kivy/kivy/core/audio/audio_sdl2.c:4527:69: error: use of undeclared identifier 'MIX_INIT_MODPLUG'; did you mean 'MIX_INIT_MOD'?
  __pyx_t_2 = ((__pyx_v_4kivy_4core_5audio_10audio_sdl2_mix_flags & MIX_INIT_MODPLUG) != 0);
                                                                    ^~~~~~~~~~~~~~~~
                                                                    MIX_INIT_MOD
/usr/local/include/SDL2/SDL_mixer.h:80:5: note: 'MIX_INIT_MOD' declared here
    MIX_INIT_MOD    = 0x00000002,
    ^
3 errors generated.
 error: command 'cc' failed with exit status 1

error
Cleaning up...
Removing source in /private/tmp/pip-build-ZqJR8f/kivy
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-ZqJR8f/kivy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-LtAhbV-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-ZqJR8f/kivy/
Exception information:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 878, in install
spinner=spinner,
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 707, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-ZqJR8f/kivy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-LtAhbV-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-ZqJR8f/kivy/

Looks like #5457

As @parabolize said, it's the SDL2_mixer related issue. Try to install this way the master branch:

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

and it should compile properly.

That also didn't work... :/
I've pasted the entirety of the output from your suggestion onto Pastebin, link below.

https://pastebin.com/qPcE3Umx

@parabolize I'm not a mac user, but it looks like a permission issue to me because of the log below:

...
    running install_data
    creating /System/Library/Frameworks/Python.framework/Versions/2.7/share
     error: could not create '/System/Library/Frameworks/Python.framework/Versions/2.7/share': Operation not permitted
error
...

So you could try to add the --user flag to your pip install.

pip install --user --verbose https://github.com/kivy/kivy/zipball/master

Successfully installed Kivy-1.10.1.dev0
Cleaning up...

Good stuff @AndreMiras! That finally did the trick. Thank you so much to all of you for the help. I look forward to making kivy into some sweet apps.

Had the same problem with python 3.6.2 on High Sierra and @AndreMiras solution worked! Thanks!

Was this page helpful?
0 / 5 - 0 ratings