Kivy is an open-source software library for the rapid development of applications equipped with novel user interfaces, such as multi-touch apps.
Creating Kivy apps is fun and rewarding. You will require a basic knowledge of Python to work with Kivy. Using Kivy we can create apps that run on:
- Desktop computers: OS X, Linux, Windows.
- iOS devices: iPad, iPhone.
- Android devices: tablets, phones.
Any other touch-enabled professional/homebrew devices supporting TUIO (Tangible User Interface Objects).
Installation of Kivy
The easiest way to install Kivy is with
pip, which installs Kivy using either a pre-compiled wheel, if available, otherwise from the source. Kivy provides pre-compiled wheels for the supported Python versions on Windows, OS X, Linux, and RPi.
Before Kivy can be installed Python, pip and other installation dependencies need to be pre-installed.
- Update the pip and wheel before installing Kivy using the following CMD command:
python -m pip install --upgrade pip wheel setuptools
- Install dependencies
python -m pip install docutils pygments pypiwin32 kivy.deps.sdl2 kivy.deps.glew python -m pip install kivy.deps.gstreamer python -m pip install kivy.deps.angl
- Finally, install Kivy
python -m pip install kivy
For all Linux distribution, we have two options to install Kivy either to install all the Kivy dependencies manually or use Software Packages like PPA etc. as below:
For: Ubuntu / Kubuntu / Xubuntu / Lubuntu (Saucy and above)
- Add PPA
$ sudo add-apt-repository ppa:kivy-team/kivy
- Update package list using the package manager
$ sudo apt-get update
- Install Kivy
$ pip install kivy[full]
import kivy print(kivy.__version__)
The above code will result in a ledger book like as follows:
What is PIP and What are wheels?
In Python, packages such as Kivy can be installed with the python package manager, named pip (“python install package”).
When installing from source, some packages, such as Kivy, require additional steps, like a compilation.
Contrary, wheels (files with a –
.whl extension) are pre-built distributions of a package that has already been compiled. These wheels do not require additional steps when installing them.