Installing Kivy on OS-X from PIP and Homebrew

Begin by following this guide to get your python environment setup.

If you aren’t using virtualenv, then feel free to ignore those commands (mkvirtalenv, cdvirtualenv).

Remember to run ‘brew’ commands as the current user and not root.

Install SDL

brew install sdl sdl_image sdl_mixer sdl_ttf smpeg portmidi

Install Mercurial to gain access to PyGame repository.

brew install mercurial

Create a virtual environment to work in

mkvirtualenv kivy
cdvirtualenv

Install our Kivy dependencies and then finally, Kivy itself.

pip install cython
pip install pil
pip install hg+http://bitbucket.org/pygame/pygame</pre>
pip install kivy

If you don’t install PIL or PyGame, you will get errors such as this

(kivy-test)Vibur:kivy-test adamgriffiths$ python src/main.py 
[INFO   ] Kivy v1.1.1
[INFO   ] [Logger      ] Record log in /Users/adamgriffiths/.kivy/logs/kivy_12-03-19_4.txt
[INFO   ] [Factory     ] 102 symbols loaded
[WARNING] [Image       ] Unable to use <pygame> as loader!
[WARNING] [Image       ] Unable to use <pil> as loader!
[WARNING] [Text        ] Unable to use <pygame> as textprovider
[WARNING] [Text        ] Associated module are missing
[WARNING] [Text        ] Unable to use <pil> as textprovider
[WARNING] [Text        ] Associated module are missing
[CRITICAL] [Text        ] Unable to find any valuable Text provider at all!
 Traceback (most recent call last):
   File "src/main.py", line 2, in <module>
     from kivy.uix.button import Button
   File "/Users/adamgriffiths/Workspace/VirtualEnvs/kivy-test/lib/python2.7/site-packages/kivy/uix/button.py", line 38, in <module>
     from kivy.uix.label import Label
   File "/Users/adamgriffiths/Workspace/VirtualEnvs/kivy-test/lib/python2.7/site-packages/kivy/uix/label.py", line 94, in <module>
     from kivy.core.text import Label as CoreLabel
   File "/Users/adamgriffiths/Workspace/VirtualEnvs/kivy-test/lib/python2.7/site-packages/kivy/core/text/__init__.py", line 520, in <module>
     Label.register('DroidSans',
 AttributeError: 'NoneType' object has no attribute 'register'
Advertisements

2 Responses to “Installing Kivy on OS-X from PIP and Homebrew”

  1. to install smpeg currently you need the HEAD version as stated in https://github.com/samueljohn/homebrew-python/issues/22

  2. My brother suggested I might like this web site.
    He was entirely right. This put up actually made my day.

    You can not believe simply how so much time I
    had spent for this info! Thank you!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: