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,423
  • Did the install commands work or were there errors? – jmetz Apr 29 '14 at 14:32
  • Some missing dependencies: " Die folgenden Pakete haben unerfüllte Abhängigkeiten: kivy : Hängt ab von: python3-kivy (>= 1.8.1-daily0+201404281119-2007-testing42~ubuntu14.04.1) soll aber nicht installiert werden E: Probleme können nicht korrigiert werden, Sie haben zurückgehaltene defekte Pakete. – empedokles Apr 29 '14 at 14:40
  • Ok well that's the problem then. Did you try running sudo apt-get install python3-kivy? – jmetz Apr 29 '14 at 14:50
  • I get something similar then: "Die folgenden Pakete haben unerfüllte Abhängigkeiten: python3-kivy : Hängt ab von: python3-pygame ist aber nicht installierbar E: Probleme können nicht korrigiert werden, Sie haben zurückgehaltene defekte Pakete." – empedokles Apr 29 '14 at 15:11
  • Do you have python3 installed? – jmetz Apr 29 '14 at 16:28
  • Yeah, it comes onboard with 14.04. – empedokles Apr 30 '14 at 11:03
  • OK well I suggest you keep going; your last error was about python3-pygame not being installed - install that, and if that says a dependency is missing, install the missing dependency, and so on. – jmetz Apr 30 '14 at 11:05
  • I tried http://www.pygame.org/wiki/CompileUbuntu but there is an ffmpg not working.. – empedokles Apr 30 '14 at 13:23
  • Can't you install via apt-get? – jmetz Apr 30 '14 at 13:24
  • Is there a apt-get possibility? I now seem to get kivy to run under python2: the error was: sudo get-apt install python-kivy instead of python3-kivy – empedokles Apr 30 '14 at 13:26
  • I can't use python3 though. python2 kivytest.py shows following in the terminal: [INFO ] [Logger ] Record log in /home/empedokles/.kivy/logs/kivy_14-04-30_1.txt [INFO ] Kivy v1.8.1-dev [INFO ] [Python ] v2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] [INFO ] [Factory ] 157 symbols loaded [INFO ] [Image ] Providers: img_tex, img_dds, shortened.. – empedokles Apr 30 '14 at 13:31

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
  • how to install it in virtualenv? possibly using pip install I like to keep everything in virtualenvs, I hate using apt-get for python packages unless I absolutely have to – Lynob May 17 '14 at 13:11
  • Can you dot hat using dh-virtualenv? See –  May 17 '14 at 13:14
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
  • 114,770
programkai
  • 61
  • 4
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
  • 114,770
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
  • 114,770