Getting started with Kivy

Kivy is a popular cross platform open source library for developing applications involving different user interfaces. Currently, Kivy is running on Linux, Windows, MacOSX, Android and iOS.

Let’s start by downloading Kivy for Windows from here : Kivy for Windows.

Unzip the downloaded file to find the kivy.bat file shown below:

Copy the path to this folder.

Now right click My Computer -> Properties -> Advanced System Settings -> Environment Variables

Select Path under System variables and click on Edit. Add the path you copied at the end of the Variable Value entry followed by a semicolon(;)

Open up a command prompt and type kivy to see whether kivy has be set up properly. You should see a message saying “done bootstrapping kivy..”

That completes the Kivy installation for Windows. Now moving on, let’s try a simple program.

Open any editor such as Notepad++ or best you can use the Python IDLE that comes along with a standard Python installation.

Write the following code:

import kivy

from import App
from kivy.uix.image import Image
from kivy.uix.widget import Widget

class ShowImage(Image):
class MyApp(App):
	  def build(self):
		    return ShowImage(source='tech2.jpg',pos=(30, 130),size=(256, 256))
if __name__ == '__main__':

Save the above file as The above code is used to display an Image using Kivy. ‘tech2.jpg’ is the name of the image file. Note that the image file and the file should be placed inside the same folder.

Now switch to command prompt once again, navigate to the folder contain the python file and type the command –> kivy

You should see a screen with an image as below:

Karan Balkar About Karan Balkar
self proclaimed extraterrestrial fandroid, computer engineer, amateur gamer and die hard punk rock fan!

4 thoughts on “Getting started with Kivy

  1. Is there a way I can stream a video from the server?
    Now if i have a video like a .avi or .flv on a server and use a URL to address it will I be able to play the video on the VideoPlayer widget? I tried and i was not able to play it

Leave a Reply

Your email address will not be published. Required fields are marked *