- Kivy Cookbook
- Hugo Solis
- 487字
- 2021-07-16 20:39:54
Installing Kivy
This recipe will teach you how to install Kivy on a personal computer, which is the first step in starting to develop great software.
Getting ready
We will assume that you already have GNU/Linux (preferably Ubuntu/Debian/Trisquel, we recommend the last one) and Python installed on it. Usually, Python is already installed on the aforementioned GNU/Linux distributions. We will also assume that you are using Python version 2.7 or higher.
How to do it…
- Add one of the Personal Package Archives (PPAs) that you prefer; our recommendation is the following stable one:
stable builds: $ sudo add-apt-repository ppa:kivy- team/kivy nightly builds: $ sudo add-apt-repository ppa:kivy- team/kivy-daily
- Update your package list using your package manager:
$ sudo apt-get update
- Install Python-kivy and, optionally, the examples that are found in Python-kivy-examples:
$ sudo apt-get install Python-kivy
- Verify the installation. Call Python from the console and execute this command:
import kivy
How it works…
There are many ways to get Kivy installed on your computer. Here we are describing probably the easiest way using your distribution's package manager. In the first step, we are adding a PPA as an APT repository to provide you with two different options: the stable one, for which all the Kivy products have been well tested, and the nightly one, which are packages under active development. Actually, for Ubuntu, you can skip the first step; it was just to get the latest version of Kivy.
In the second step, we update the list of available packages to include the Kivy repository. The third step is where the installation of Kivy really happens by using the distribution's package manager. In the last step, we verify if Kivy is working with the command that imports Kivy. If everything is OK we will see the following:
[INFO ] Kivy v1.9.0
It shows the Kivy version that you installed in your system, which is v1.9.0
in this case. Remember to exit Python, for which we use the command quit()
.
There's more…
Now we will say something about Mac OS X and Microsoft Windows; for them, Kivy provides what is called portable packages. For an easy way to get Kivy running, just go to http://kivy.org/#download.

See also
Well, if you are using a different operating system, you are always able to go to http://kivy.org/#download and look for the one that you are using. Also, if you want to build Kivy from the source code, refer to Chapter 8, Packaging our Apps for PC the recipe Packing for Linux.
- 數據庫程序員面試筆試真題與解析
- Docker and Kubernetes for Java Developers
- Java技術手冊(原書第7版)
- FFmpeg入門詳解:音視頻原理及應用
- 深入淺出Serverless:技術原理與應用實踐
- Python算法從菜鳥到達人
- Advanced Oracle PL/SQL Developer's Guide(Second Edition)
- Python全棧數據工程師養成攻略(視頻講解版)
- Learning PHP 7
- Go語言精進之路:從新手到高手的編程思想、方法和技巧(2)
- Visual Studio Code 權威指南
- Laravel Application Development Blueprints
- Learning Nessus for Penetration Testing
- Offer來了:Java面試核心知識點精講(框架篇)
- Hadoop Blueprints