Guide d’installation de Python¶
This guide is intended for Python teams. Java and C++ teams can skip to Guide d’installation WPILib.
Pré-requis¶
You must install a supported version of Python on a supported operating system. Every year we upgrade RobotPy to the latest available version of Python. In 2027 we support Python 3.11/3.12/3.13/3.14, but only 3.14 is available for the Systemcore.
- Système d’exploitation et Architectures supportés:
Windows 11, 64 bit only. Arm-based Windows 11 is unsupported.
Debian 13 “Trixie”, 64 bit only.
Ubuntu 26.04, 64 bit only.
macOS 15 or higher, both Intel and Arm.
Note
Linux distributions other than those mentioned above that contain glibc >= 2.41 may work, but are unsupported.
Avertissement
Windows 10 support from Microsoft ended in October 2025. While we will not explicitly block Windows 10 from being used, future releases may inadvertently break compatibility with Windows 10. We will not postpone these changes in order to maintain Windows 10 compatibility, and Windows 10 support may break as a result.
Sur Windows et macOS, nous vous recommandons d’utiliser les installateurs officiels de Python distribués par python.org.
Installation de RobotPy¶
Une fois que vous avez installé Python, vous pouvez utiliser pip pour installer RobotPy sur votre ordinateur de développement.
Note
Si vous avez précédemment installé une version de RobotPy antérieure à 2024 ou une version bêta 2024, vous devez d’abord désinstaller RobotPy via py -m pip uninstall robotpy avant la mise à niveau.
Avertissement
On Windows, the Visual Studio 2026 redistributable package is required to be installed.
Exécutez la commande suivante depuis cmd ou Powershell pour installer les packages de base de RobotPy:
py -3 -m pip install robotpy
Pour effectuer une mise à niveau, vous pouvez exécuter ceci:
py -3 -m pip install --upgrade robotpy
If you don’t have administrative rights on your computer, either use virtualenv/virtualenvwrapper-win, or or you can install to the user site-packages directory:
py -3 -m pip install --user robotpy
Note
Si vous avez précédemment installé une version de RobotPy antérieure à 2024 ou une version bêta 2024, vous devez d’abord désinstaller robotpy via python3 -m pip uninstall robotpy avant la mise à niveau.
Sur un système macOS avec pip installé, exécutez simplement la commande suivante depuis l’application Terminal (peut nécessiter des droits d’administrateur):
python3 -m pip install robotpy
Pour effectuer une mise à niveau, vous pouvez exécuter ceci:
python3 -m pip install --upgrade robotpy
Si vous n’avez pas de droits administratifs sur votre ordinateur, utilisez soit virtualenv/virtualenvwrapper, ou vous pouvez réaliser l’installation dans le répertoire des packages utilisateur:
python3 -m pip install --user robotpy
Note
Si vous avez précédemment installé une version de RobotPy antérieure à 2024 ou une version bêta 2024, vous devez d’abord désinstaller robotpy via python3 -m pip uninstall robotpy avant la mise à niveau.
RobotPy distribue des wheels binaires manylinux sur PyPI. Cependant, l’installation de celles-ci nécessite une distribution avec glibc 2.35 ou plus récente, et un installateur qui implémente PEP 600, tel que pip 20.3 ou plus récent. Vous pouvez vérifier votre version de pip avec la commande suivante:
python3 -m pip --version
If you need to upgrade your version of pip, it is highly recommended to use a virtual environment.
Si vous avez une version compatible de pip, vous pouvez simplement exécuter:
python3 -m pip install robotpy
Pour effectuer une mise à niveau, vous pouvez exécuter ceci:
python3 -m pip install --upgrade robotpy
Si vous parvenez à installer les packages et obtenez l’erreur suivante ou quelque chose de similaire, votre système n’est probablement pas compatible avec RobotPy:
OSError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by /usr/local/lib/python3.7/dist-packages/wpiutil/lib/libwpiutil.so)
Nous publions des wheels préconstruites sur artifactory, qui peuvent être téléchargées en donnant l’option --extra-index-url à pip:
python3 -m pip install --extra-index-url=https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2025/simple robotpy
Installation à partir des sources
Alternatively, if you have a C++23 compiler installed, you may be able to use pip to install RobotPy from source.
Avertissement
Cela peut prendre beaucoup de temps à installer!
Avertissement
Mélanger nos wheels préconstruits avec des installations à partir de la source peut provoquer des erreurs d’exécution. Cela est dû à une incompatibilité interne de l’ABI entre les versions de compilateurs.
Our ARM wheels are built for Debian 13 (Trixie) with GCC 14.
If you need to build with a specific compiler version, you can specify them using the CC and CXX environment variables:
export CC=gcc-14 CXX=g++-14
Download RobotPy for Systemcore¶
Après avoir installé le projet robotpy sur votre ordinateur, diverses commandes sont disponibles et peuvent être exécutées par invite de commande via le module robotpy.
If you already have a RobotPy robot project, you can use that to download the pieces needed to run on the Systemcore. If you don’t have a project, running this command in an empty directory will initialize a new robot project:
py -3 -m robotpy init
python3 -m robotpy init
python3 -m robotpy init
This will create a robot.py and pyproject.toml file. The robot.py file contains a skeleton structure to help you get started writing your robot code. The pyproject.toml file should be customized and details the requirements needed to run your robot code, among other things.
Important
The robotpy deploy command requires that you have written working robot code. The generated robot.py is just a starting point - you cannot deploy to the Systemcore until you have implemented your robot-specific code. See the RobotPy Programming Guide for information on writing robot code.
Voir aussi
Le fichier pyproject.toml créé par défaut ne contient que la version de RobotPy installée sur votre ordinateur. Si vous souhaitez activer les packages vendeurs ou installer d’autres packages Python depuis PyPI, consultez notre documentation pyproject.toml
Ensuite, exécutez la sous-commande robotpy sync, qui:
Download Python compiled for Systemcore, if it is not already installed
Download Systemcore compatible python packages as specified by your
pyproject.tomlInstalle les packages spécifiés dans votre
pyproject.tomldans votre environnement local
Note
Si vous n’utilisez pas un environnement virtuel et n’avez pas les privilèges d’administrateur, la commande robotpy sync accepte l’argument --user pour installer dans le répertoire des packages utilisateur.
py -3 -m robotpy sync
python3 -m robotpy sync
python3 -m robotpy sync
When you deploy your code to the Systemcore, the deploy subcommand will automatically install Python (if needed) and your robot project requirements on the Systemcore as part of the deploy process.