0

I have an error when I run this:

pip install kivy

Here is the error:

Collecting kivy
  Using cached Kivy-1.10.0.tar.gz
    Complete output from command python setup.py egg_info:
    Using distutils

    Cython is missing, it's required for compiling kivy !


    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-aHd9E8/kivy/setup.py", line 219, in <module>
        from Cython.Distutils import build_ext
    ImportError: No module named Cython.Distutils

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-aHd9E8/kivy/

So could someone help me to install this python library (for python 2.7 if possible) please, I made my researches and I did not find anything.

Mike Delta
  • 726
  • 2
  • 16
  • 32

2 Answers2

2

Install these:

brew install pkg-config sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer
xcode-select --install
pip install Cython==0.26.1 --user
pip install https://github.com/kivy/kivy/archive/master.zip

You should be able to use kivy on MacOSX high sierra

theecodedragon$ python
Python 2.7.10 (default, Jul 15 2017, 17:16:57) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import kivy
[WARNING] [Config      ] Older configuration version detected (0 instead of 20)
[WARNING] [Config      ] Upgrading configuration in progress.
[INFO   ] [Logger      ] Record log in /Users/theecodedragon/.kivy/logs/kivy_17-11-09_0.txt
[INFO   ] [Kivy        ] v1.10.1.dev0, git-Unknown, 20171108
[INFO   ] [Python      ] v2.7.10 (default, Jul 15 2017, 17:16:57) 
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
>>> 

Edit:

This works with latest version as of now:

theecodedragon$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.13.1
BuildVersion:   17B48
  • Anyone who has the equivalent information for Linux please update this. On Ubuntu 16.04, `pip install Cython && pip install kivy` worked for me. My `requirements.txt`, all in one line: `certifi==2018.11.29 chardet==3.0.4 Cython==0.29.4 docutils==0.14 idna==2.8 Kivy==1.10.1 Kivy-Garden==0.1.4 numpy==1.16.1 Pygments==2.3.1 requests==2.21.0 urllib3==1.24.1` – Nathan majicvr.com Feb 04 '19 at 12:27
0

Try installing Cython: pip install Cython.

If it doesn't help, you may be using the wrong python installation. Refer to this answer for details.

gukoff
  • 2,112
  • 3
  • 18
  • 30