Skip to content

How to install Kivy

Time 🕐

Estimated time of completion: 30min to 1h (depending on your experience and your operating system)

Requirements

Before installing Kivy, you need to install uv.

We strongly recommend you to follow this guide to install Kivy. If you ever need help, go to any support channel in the Official Kivy Discord.

Installation Guide

Please, choose your operating system and follow the instructions below:

This is the macOS installation guide. If you are using another operating system, please, select it from the menu above.

Kivy Installation on macOS - Commands Summary
curl -LsSf https://astral.sh/uv/install.sh | sh
uv python install 3.11
mkdir kivy_school
cd kivy_school
uv init
uv python pin 3.11
uv add kivy
# Add Step 4 code to main.py
uv run main.py

How to open the terminal on macOS

You can open the terminal on macOS by pressing ⌘ + Space and typing terminal in the search bar.

Step 1: Install uv

What is uv?

An extremely fast Python package and project manager, written in Rust.

from astral

How to install uv
  • Press ⌘ + Spacebar, type terminal and press enter
  • Type curl -LsSf https://astral.sh/uv/install.sh | sh and press enter.
$ curl -LsSf https://astral.sh/uv/install.sh | sh

💬 Installing uv... please wait.
downloading uv 0.8.16 aarch64-apple-darwin
installing to /Users/kivyschool/.local/bin
uv
uvx
everything's installed!

Step 2: Install Python using uv

How do I install Python using uv?
  • Type uv python install 3.11 and press enter. This will install latest Python 3.11.

$ uv python install 3.11

Step 3: Start a new project with uv

How to start a new project with uv?
  • Press ⌘ + Spacebar, type terminal and press enter

  • Type mkdir kivy_school and press enter. This will create a new folder called kivy_school.

$ mkdir kivy_school

  • Type cd kivy_school and press enter. This will change the current directory to kivy_school.

$ cd kivy_school

  • Type uv init and press enter. This will initialize a new project using uv, creating the necessary configuration files.

$ uv init

This will create a pyproject.toml file in the kivy_school directory. This is the uv configuration file, which contains the project dependencies.

This means that any library you install using uv will be added to this file. This is super useful because you can share this file with other developers and they will be able to install the same dependencies as you have.

  • Type uv add kivy and press enter. This will install Kivy.

$ uv add kivy

That's it! You have successfully installed Kivy using uv.

This is the Ubuntu installation guide. If you are using another operating system, please, select it from the menu above.

Kivy Installation on Ubuntu - Commands Summary
curl -LsSf https://astral.sh/uv/install.sh | sh
uv python install 3.11
mkdir kivy_school
cd kivy_school
uv init
uv python pin 3.11
uv add kivy
# Add Step 4 code to main.py
uv run main.py

Step 1: Install uv

What is uv?

An extremely fast Python package and project manager, written in Rust.

from astral

How to install uv
  • Open the terminal by pressing Ctrl + Alt + T
  • Type curl -LsSf https://astral.sh/uv/install.sh | sh and press enter.
$ curl -LsSf https://astral.sh/uv/install.sh | sh

💬 Installing uv... please wait.
downloading uv 0.8.16 aarch64-apple-darwin
installing to /Users/kivyschool/.local/bin
uv
uvx
everything's installed!

Step 2: Install Python using uv

How do I install Python using uv?
  • Open the terminal by pressing Ctrl + Alt + T
  • Type uv python install 3.11 and press enter. This will install latest Python 3.11.

$ uv python install 3.11

Step 3: Start a new project with uv

How to start a new project with uv?
  • Open the terminal by pressing Ctrl + Alt + T
  • Type mkdir kivy_school and press enter. This will create a new folder called kivy_school.

$ mkdir kivy_school

  • Type cd kivy_school and press enter. This will change the current directory to kivy_school.

$ cd kivy_school

  • Type uv init and press enter. This will initialize a new project using uv, creating the necessary configuration files.

$ uv init

This will create a pyproject.toml file in the kivy_school directory. This is the uv configuration file, which contains the project dependencies.

This means that any library you install using uv will be added to this file. This is super useful because you can share this file with other developers and they will be able to install the same dependencies as you have.

  • Type uv add kivy and press enter. This will install Kivy.

$ uv add kivy

That's it! You have successfully installed Kivy using uv.

This is the Windows installation guide. If you are using another operating system, please, select it from the menu above.

Step 1: Install uv

What is uv?

An extremely fast Python package and project manager, written in Rust.

from astral

How to install uv
  • Open Command Prompt or Powershell:
    • Command Prompt: Press ⊞ Win + R, type cmd and press Enter.
    • Powershell: Press ⊞ Win + R, type powershell and press Enter.
  • Type powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" and press enter.

£C:\Users\KivySchool powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

// Installing uv... please wait.
downloading uv 0.8.17 (x86_64-pc-windows-msvc)
installing to C:\Users\kivyschool\.local\bin
uv
uvx
everything's installed!

Step 2: Install Python using uv

How do I install Python using uv?
  • After installing uv, restart your terminal (Command Prompt or Powershell) to make sure the uv command is available.
  • Open Command Prompt or Powershell:
    • Command Prompt: Press ⊞ Win + R, type cmd and press Enter.
    • Powershell: Press ⊞ Win + R, type powershell and press Enter.
  • Type uv python install 3.11 and press enter. This will install latest Python 3.11.

£C:\Users\KivySchool uv python install 3.11

Step 3: Start a new project with uv

How to start a new project with uv?
  • Open Command Prompt or Powershell:
    • Command Prompt: Press ⊞ Win + R, type cmd and press Enter.
    • Powershell: Press ⊞ Win + R, type powershell and press Enter.
  • Type mkdir kivy_school and press enter. This will create a new folder called kivy_school.

    £C:\Users\KivySchool mkdir kivy_school
    

  • Type cd kivy_school and press enter. This will change the current directory to kivy_school.

£C:\Users\KivySchool cd kivy_school

  • Type uv init and press enter. This will initialize a new project using uv, creating the necessary configuration files.

£C:\Users\KivySchool uv init

This will create a pyproject.toml file in the kivy_school directory. This is the uv configuration file, which contains the project dependencies.

This means that any library you install using uv will be added to this file. This is super useful because you can share this file with other developers and they will be able to install the same dependencies as you have.

  • Type uv add kivy and press enter. This will install Kivy.

£C:\Users\KivySchool uv add kivy

That's it! You have successfully installed Kivy using uv.

Coming soon.

Coming soon.

Step 4: Run a Kivy "Hello world" example

Edit main.py file and paste the following code in it.

main.py
1
2
3
4
5
6
7
from kivy.app import runTouchApp
from kivy.lang import Builder

runTouchApp(Builder.load_string('''
Button:
    text: 'Hello world'
'''))
  • On your terminal, type uv run main.py and press enter. This will run the Kivy "Hello world" example.
$ uv run main.py

Prepare your heart for the magic!

Congratulations! You have successfully installed Kivy using uv.

Are you ready to learn more about Kivy? Let's go!