Python and MediaPipe Setup
This page helps you set up Python with MediaPipe and OSC capacities for interactive systems based on computer vision. Together, these components allow a wide range of applications. A proper setup is necessary to avoid conflicts.
Python Version
MediaPipe works with Python versions 3.8–3.12. To get the installed Python version, type the following into your terminal:
The output will provide the installed version (e.g. Python 3.12.3)
Getting the Right Python Version
If your Python is too old (<3.8) or too new (≥3.13), install or switch to a compatible version. Recommended versions: 3.10 - 3.12 (stable and widely supported). The following sections show the steps for the most common operating systems.
Windows
Uninstall older versions if needed from Add or Remove Programs.
Download the 64-bit installer from: https://www.python.org/downloads/windows/
During installation: - Tick Add Python to PATH - Under Customize installation, ensure pip and venv are selected.
-
Open a new PowerShell or Command Prompt and verify:
macOS
Option 1 – Use the official universal installer:
After installation, confirm:
Option 2 – Use Homebrew (if installed):
Linux
On most systems you can install a supported version via package manager.
Ubuntu / Debian:
Then explicitly use that version:
Fedora:
Arch / Manjaro:
After installation, confirm the version again:
Check for pip
pip is Python's package installer - we need it to install dependencies. Make sure pip is available on your system:
Virtual Environment and Dependencies
We are using virtual environments to make sure we are using only the packages and versions we need for a specific project. This avoids confusions with different installs.
First, verify that pip is available, by typing the following in the terminal:
Create and activate a virtual environment - this step is the same for all operating systems:
To activate te venv on macOS/Linux, enter:
For Windows (PowerShell) type:
You will see that your venv is activated when the terminal shows (cv2pd).
Install Packages with pip
You can verify the install by typing:
You should see: opencv-python, numpy, python-osc
