6

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'
Clayton
  • 1,431

4 Answers4

4

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
4

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.

karel
  • 122,292
  • 133
  • 301
  • 332
2

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

karel
  • 122,292
  • 133
  • 301
  • 332
0

Kivy - Multimedia / Multitouch framework in Python is in the default repositories in Ubuntu 16.04, Ubuntu 18.04, and 19.10 and later. To install it, open the terminal and type:

sudo apt install python3-kivy # for Python 3.x # 16.04, 18.04 + 19.10 and later

or

sudo apt install python-kivy  # for Python 2.x in 18.04 and earlier

python3-kivy has been dropped from the default repositories in Ubuntu 19.04 because of a software bug that also affects python3-kivy in Ubuntu 18.04. There is a workaround for this bug which is described in this answer.

karel
  • 122,292
  • 133
  • 301
  • 332