Before you start building apps with Kivy you will need to have a working installation of Kivy on your system. If you don't have it set up yet, the following steps will guide you through the process, whether you're on Windows, macOS or Linux.
If you don't have an installation of Python 3, you will need to install one first. You can download installers for Python 3 from the Python homepage. Once installed, you should be able to follow the instructions below.
Setup your Project Environment & Install Kivy
To keep your projects self-contained, we recommend created a new virtual environment for each project. If you're just learning, you can create a virtual environment for working through the tutorials in.
If you later want to create a new folder for a different project, you can just repeat this process.
Below are the instructions for creating a new project folder, creating a virtual environment and installing Kivy, on Windows, macOS and Linux.
- Windows
- macOS
- Linux
> mkdir myapp/
> cd myapp
> python -m venv venv
> venv\Scripts\activate.bat
(venv)> pip install kivy
$ mkdir myapp/
$ cd myapp
$ python -m venv venv
$ source venv/bin/activate
(venv)$ pip install kivy
$ mkdir myapp/
$ cd myapp
$ python -m venv venv
$ source venv/bin/activate
(venv)$ pip install kivy
Once complete, start python by running python
from the command line. You should then be able to import Kivy with the following.
import kivy
If that import works Kivy is correctly set up & you're now ready to start working with Kivy.