Kivy is an opensource multi-platform GUI development library for Python and can run on iOS, Android, Windows, OS X, and GNU/Linux. It helps develop applications that make use of innovative, multi-touch UI. The fundamental idea behind Kivy is to enable the developer to build an app once and use it across all devices, making the code reusable and deployable, allowing for quick and easy interaction design and rapid prototyping.
There are several ways to get Kivy installed in your system, depending upon your Operating System. Let’s dive into it.
- Using pip
pip install kivy
- Using conda
conda install -c conda-forge kivy
- Add the PPA using the following command:
sudo add-apt-repository ppa:kivy-team/kivy
- Update your package list using your package manager-
sudo apt-get update
- Install Kivy
sudo apt-get install python3-kivy
- Using Wheels
Wheels are precompiled binaries for the specific platform you are on. All you need to do to install Kivy using wheels on osx is
$ python -m pip install kivy
Hello World in Kivy
- Let’s create a Python file i.e. with
- First of all let’s import kivy and ensure it’s up-to-date.
import kivy # Replace this with your # current version kivy.require('1.11.1') # To find your kivy version use, # print(kivy.__version__)
- Now to create a Kivy interface we need to import Kivy App module in our program using the following code:
from kivy.app import App
- Now import Label from
from kivy.uix.label import Label
- Now let’s write main block that prints Hello World, yayy finally!!
class MyFirstKivyApp(App): def build(self): return Label(text ="Hello World !")
- Hello World Program : First program while learning Programming
- The "Hello World" To Programming
- PyQt Hello World
- Hello World in Tkinter
- Printing HELLO with turtle module
- Python | Tools in the world of Web Scraping
- Puzzle | Minimum planes to go around the world
- Diving into the Linux World
- Small World Model - Using Python Networkx
- How world-wide-web (www) is different from the Internet ?
- AI | The Wumpus World Description
- Will Julia Become the Empress of the Artificial Intelligence World?
- Plotting World Map Using Pygal in Python
- Python - Retrieve latest Covid-19 World Data using COVID19Py library
- Python | Kivy .kv File
- Introduction to Kivy ; A Cross-platform Python Framework
- Python | Ellipse (different polygons) in Kivy
- Python | Scrollview widget in kivy
- Text Input box with a verification button in kivy
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.