How to install kivy under ubuntu?

Can someone provide me with clear install instructions for kivy?

Their install instruction is not very good. But I have tried, which I've found here:

sudo add-apt-repository ppa:kivy-team/kivy
sudo apt-get update
sudo apt-get install kivy

Put their example inside kivytest.py and get:

Traceback (most recent call last):
  File "kivytest.py", line 1, in <module>
    from kivy.app import App
ImportError: No module named 'kivy'

In ubuntu Kivy is built from the packages python-kivy, python-kivy-examples.

So install following packages.

sudo apt-get install python-kivy python-kivy-examples debhelper python python-all-dev cython libgl1-mesa-dev libgles2-mesa-dev

The installation page of Kivy gives a hint:

sudo add-apt-repository ppa:thopiekar/pygame  
sudo apt-get update

I used Synaptic package manager for this purpose as this way I could see directly whether python3-pygame is available or not, but the terminal command will do the job as well. Everything executed successfully on Ubuntu 14.04.

Let's move on to python3.

Reason: pygames is only shipped in a version for python 2 with Ubuntu at this point in time. There are some pages describing how to create a python3 version yourself (for the German users above: http://wiki.ubuntuusers.de/Pygame), but obviously this is a bit tedious.


You may be using Python3. To install Kivy under Python 2.x and Python 3.x:

sudo add-apt-repository ppa:kivy-team/kivy # stable builds repository
sudo apt-get update 
sudo apt-get install python-kivy python3-kivy python-kivy-examples  

Reference: Installation on Linux — Kivy documentation