Based on source: [https://kivy.org/doc/stable-1.11.1/guide/basic.html]
NOTE: The script is only tested on Ubuntu 22.04. The package may be different when using another version of Linux kernel.
Install Python3.7
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.7 python3.7-dev python3.7-venv -y
Install OpenCV
sudo apt install -y python3-opencv
If gstreamer
is needed (This is NOT required on Linux [https://kivy.org/doc/stable/gettingstarted/installation.html#installing-kivy-s-dependencies]):
sudo apt install -y libgstreamer-opencv1.0-0 libgstreamer1.0-0 libgstreamer1.0-dev
Install SDL2 on Linux
sudo apt install -y libsdl2-2.0-0 libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev
Create virtual environment
python3.7 -m venv venv
. ./venv/bin/activate
pip install --upgrade pip
# Avoid using the broken pre-build wheel
pip install --no-binary=kivy kivy==1.11.1
pip install -r requirements.txt
python ./venv/share/kivy-examples/camera/main.py
If it crashes, try:
pip install opencv-python
python -m build
# install the package from wheel
pip install ./dist/kivy_demo-0.1.0-py3-none-any.whl
- Hello world (
Label
) - Build a login dialog (
GridLayout
) - Using properties
- Kv script:
Button
- Kv script:
AsyncImage
- Kv script: Inherent classes
- Kv script: zip file (sequence of images) as background
- Handle exception when camera is not connected
- Xbox controller