2025-05-02 12:47:23 +02:00
# Installation
2026-04-05 19:24:43 +02:00
This guide uses `conda` (via miniforge) to manage environments (recommended). If you prefer another environment manager (e.g. `uv`, `venv`), ensure you have Python >=3.12 and support PyTorch >= 2.10, then skip ahead to [Environment Setup](#step-2-environment-setup).
2026-02-10 14:18:32 +00:00
2026-03-08 13:00:06 +01:00
## Step 1 (`conda` only): Install [`miniforge`](https://conda-forge.org/download/)
2025-10-19 19:19:21 +02:00
```bash
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh
```
2026-02-10 14:18:32 +00:00
## Step 2: Environment Setup
2025-05-02 12:47:23 +02:00
2026-03-08 13:00:06 +01:00
Create a virtual environment with Python 3.12:
2025-07-17 14:30:20 +02:00
2026-03-08 13:00:06 +01:00
<!-- prettier-ignore-start -->
<hfoptions id="create_venv">
<hfoption id="conda">
2025-05-02 12:47:23 +02:00
```bash
2026-03-06 10:15:13 +01:00
conda create -y -n lerobot python=3.12
2025-05-02 12:47:23 +02:00
```
2026-03-08 13:00:06 +01:00
</hfoption>
2026-04-05 19:24:43 +02:00
<hfoption id="uv (PyTorch >= 2.10 only)">
2026-03-08 13:00:06 +01:00
```bash
uv python install 3.12
uv venv --python 3.12
```
</hfoption>
</hfoptions>
<!-- prettier-ignore-end -->
2025-05-02 12:47:23 +02:00
2026-03-08 13:00:06 +01:00
Then activate your virtual environment, you have to do this each time you open a shell to use lerobot:
2025-07-17 14:30:20 +02:00
2026-03-08 13:00:06 +01:00
<!-- prettier-ignore-start -->
2026-04-05 19:24:43 +02:00
2026-03-08 13:00:06 +01:00
<hfoptions id="activate_venv">
2026-04-05 19:24:43 +02:00
<hfoption id="conda">
```bash
2025-05-02 12:47:23 +02:00
conda activate lerobot
2026-04-05 19:24:43 +02:00
```
> [!NOTE]
> When installing LeRobot inside WSL (Windows Subsystem for Linux), make sure to also install `evdev`:
>
> ```bash
> conda install evdev -c conda-forge
> ```
</hfoption>
<hfoption id="uv (PyTorch >= 2.10 only)">
2026-03-08 13:00:06 +01:00
```bash
2026-04-05 19:24:43 +02:00
# Linux/macOS
2026-03-08 13:00:06 +01:00
source .venv/bin/activate
# Windows PowerShell
2026-04-05 19:24:43 +02:00
.venv\Scripts\activate
2025-05-02 12:47:23 +02:00
```
2026-04-05 19:24:43 +02:00
> [!NOTE]
> When installing LeRobot inside WSL (Windows Subsystem for Linux), make sure to also install `evdev`:
>
> ```bash
> sudo apt install libevdev-dev
> uv pip install evdev
> ```
2026-03-08 13:00:06 +01:00
</hfoption>
</hfoptions>
<!-- prettier-ignore-end -->
2025-05-02 12:47:23 +02:00
2026-04-05 19:24:43 +02:00
### Install `ffmpeg` (for video decoding)
LeRobot uses [TorchCodec](https://github.com/meta-pytorch/torchcodec) for video decoding by default, which requires `ffmpeg`.
> [!NOTE]
> **Platform support:** TorchCodec is **not available** on macOS Intel (x86_64), Linux ARM (aarch64, arm64, armv7l), or Windows with PyTorch < 2.8. On these platforms, LeRobot automatically falls back to `pyav` — so you do not need to install `ffmpeg` and can skip to Step 3.
If your platform supports TorchCodec, install `ffmpeg` using one of the methods below:
<!-- prettier-ignore-start -->
<hfoptions id="install_ffmpeg">
<hfoption id="conda (any PyTorch version)">
Install `ffmpeg` in your conda environment. This works with **all PyTorch versions** and is **required for PyTorch < 2.10**:
2025-07-17 14:30:20 +02:00
2025-05-02 12:47:23 +02:00
```bash
conda install ffmpeg -c conda-forge
```
> [!TIP]
2026-04-05 19:24:43 +02:00
> This usually installs `ffmpeg 8.X` with the `libsvtav1` encoder. If you run into issues (e.g. `libsvtav1` missing — check with `ffmpeg -encoders` — or a version mismatch with `torchcodec`), you can explicitly install `ffmpeg 7.1.1` using:
2025-07-17 14:30:20 +02:00
>
> ```bash
> conda install ffmpeg=7.1.1 -c conda-forge
> ```
2025-05-02 12:47:23 +02:00
2026-04-05 19:24:43 +02:00
</hfoption>
<hfoption id="uv (PyTorch >= 2.10 only)">
Starting with **PyTorch >= 2.10** (TorchCodec ≥ 0.10), TorchCodec can dynamically link to a system-wide `ffmpeg` installation. This is useful when using `uv` or other non-`conda` environment managers:
```bash
# Ubuntu/Debian
sudo apt install ffmpeg
# macOS (Apple Silicon)
brew install ffmpeg
```
2026-02-23 20:41:20 +01:00
2026-03-08 13:00:06 +01:00
> [!IMPORTANT]
2026-04-05 19:24:43 +02:00
> System-wide `ffmpeg` is **only supported with PyTorch >= 2.10** (TorchCodec ≥ 0.10). For older PyTorch versions, you **must** use `conda install ffmpeg -c conda-forge` instead.
</hfoption>
</hfoptions>
<!-- prettier-ignore-end -->
2026-03-08 13:00:06 +01:00
2026-02-10 14:18:32 +00:00
## Step 3: Install LeRobot 🤗
2025-08-06 15:06:36 +02:00
2026-04-12 20:03:04 +02:00
The base `lerobot` install is intentionally **lightweight** — it includes only core ML dependencies (PyTorch, torchvision, numpy, opencv, einops, draccus, huggingface-hub, gymnasium, safetensors). Heavier dependencies are gated behind optional extras so you only install what you need.
2025-08-06 15:06:36 +02:00
### From Source
First, clone the repository and navigate into the directory:
```bash
git clone https://github.com/huggingface/lerobot.git
cd lerobot
```
Then, install the library in editable mode. This is useful if you plan to contribute to the code.
2025-07-17 14:30:20 +02:00
2026-03-08 13:00:06 +01:00
<!-- prettier-ignore-start -->
<hfoptions id="install_lerobot_src">
<hfoption id="conda">
2025-05-02 12:47:23 +02:00
```bash
2026-04-12 20:03:04 +02:00
pip install -e ".[core_scripts]" # For robot workflows (recording, replaying, calibrate)
pip install -e ".[training]" # For training policies
pip install -e ".[all]" # Everything (all policies, envs, hardware, dev tools)
2025-05-02 12:47:23 +02:00
```
2026-03-08 13:00:06 +01:00
</hfoption>
<hfoption id="uv">
```bash
2026-04-12 20:03:04 +02:00
uv pip install -e ".[core_scripts]" # For robot workflows (recording, replaying, calibrate)
uv pip install -e ".[training]" # For training policies
uv pip install -e ".[all]" # Everything (all policies, envs, hardware, dev tools)
2026-03-08 13:00:06 +01:00
```
</hfoption>
</hfoptions>
<!-- prettier-ignore-end -->
2025-05-02 12:47:23 +02:00
2025-08-06 15:06:36 +02:00
### Installation from PyPI
**Core Library:**
Install the base package with:
2026-03-08 13:00:06 +01:00
<!-- prettier-ignore-start -->
<hfoptions id="install_lerobot_pypi">
<hfoption id="conda">
2025-08-06 15:06:36 +02:00
```bash
pip install lerobot
```
2026-03-08 13:00:06 +01:00
</hfoption>
<hfoption id="uv">
```bash
uv pip install lerobot
```
</hfoption>
</hfoptions>
<!-- prettier-ignore-end -->
2025-08-06 15:06:36 +02:00
2026-04-12 20:03:04 +02:00
_This installs only the core ML dependencies. You will need to add extras for most workflows._
**Feature Extras:**
LeRobot provides **feature-scoped extras** that map to common workflows. If you are using `uv`, replace `pip install` with `uv pip install` in the commands below.
| Extra | What it adds | Typical use case |
| ---------- | ------------------------------------------- | ----------------------------------- |
| `dataset` | `datasets`, `av`, `torchcodec`, `jsonlines` | Loading & creating datasets |
| `training` | `dataset` + `accelerate`, `wandb` | Training policies |
| `hardware` | `pynput`, `pyserial`, `deepdiff` | Connecting to real robots |
| `viz` | `rerun-sdk` | Visualization during recording/eval |
**Composite Extras** combine feature extras for common CLI scripts:
2025-08-06 15:06:36 +02:00
2026-04-12 20:03:04 +02:00
| Extra | Includes | Typical use case |
| -------------- | ------------------------------ | ------------------------------------------------------- |
| `core_scripts` | `dataset` + `hardware` + `viz` | `lerobot-record`, `lerobot-replay`, `lerobot-calibrate` |
| `evaluation` | `av` | `lerobot-eval` (add policy + env extras as needed) |
| `dataset_viz` | `dataset` + `viz` | `lerobot-dataset-viz`, `lerobot-imgtransform-viz` |
2025-08-06 15:06:36 +02:00
```bash
2026-04-12 20:03:04 +02:00
pip install 'lerobot[core_scripts]' # Record, replay, calibrate
pip install 'lerobot[training]' # Train policies
pip install 'lerobot[core_scripts,training]' # Record + train
pip install 'lerobot[all]' # Everything
2025-08-06 15:06:36 +02:00
```
2026-04-12 20:03:04 +02:00
**Policy, environment, and hardware extras** are still available for specific dependencies:
```bash
pip install 'lerobot[pi]' # Pi0/Pi0.5/Pi0-FAST policy deps
pip install 'lerobot[smolvla]' # SmolVLA policy deps
pip install 'lerobot[diffusion]' # Diffusion policy deps (diffusers)
pip install 'lerobot[aloha,pusht]' # Simulation environments
pip install 'lerobot[feetech]' # Feetech motor support
```
2025-08-06 15:06:36 +02:00
2026-04-12 20:03:04 +02:00
_Multiple extras can be combined (e.g., `.[core_scripts,pi,pusht]`). For a full list of available extras, refer to `pyproject.toml`._
2025-08-06 15:06:36 +02:00
2026-05-11 19:47:55 +02:00
### PyTorch CUDA variant (Linux only)
On Linux, the install path determines which CUDA wheel you get. macOS and Windows installs use the PyPI default (MPS / CPU / CUDA-Windows wheel respectively) and can skip this section.
<!-- prettier-ignore-start -->
<hfoptions id="cuda_variant">
<hfoption id="uv-source">
**Source install via `uv` (`uv sync` or `uv pip install -e .`)**
`torch` and `torchvision` are pinned by the project to the **CUDA 12.8** PyTorch index (`https://download.pytorch.org/whl/cu128`, driver floor **570.86**) — covers Ampere/Ada/Hopper/Blackwell GPUs. No action needed for typical NVIDIA setups.
To override for a different CUDA variant:
```bash
uv pip install --force-reinstall torch torchvision \
--index-url https://download.pytorch.org/whl/cu126 # older drivers; or cu130 for Blackwell on driver ≥ 580
```
</hfoption>
<hfoption id="pip-conda">
**Source install via `pip`/`conda`, or `pip install lerobot` from PyPI**
PyPI default torch wheel is currently a cu130-bundled Linux wheel, driver floor **580.65**.
To pick a specific CUDA variant:
**Using `pip` or `conda`** — install torch first with an explicit index, then lerobot:
```bash
pip install --index-url https://download.pytorch.org/whl/cu128 torch torchvision
pip install -e ".[all]" # source
# — or —
pip install lerobot # from PyPI
```
**Using `uv` to install from PyPI** — one-liner via `--torch-backend` (uv ≥ 0.6):
```bash
uv pip install --torch-backend cu128 lerobot
```
Supported values include `auto`, `cpu`, `cu126`, `cu128`, `cu129`, `cu130`, plus various `rocm*` and `xpu`. Swap as needed for your driver.
</hfoption>
</hfoptions>
<!-- prettier-ignore-end -->
2025-06-05 17:48:43 +02:00
### Troubleshooting
2025-07-17 14:30:20 +02:00
2026-04-12 20:03:04 +02:00
If you encounter build errors, you may need to install additional system dependencies: `cmake`, `build-essential`, and `ffmpeg libs`.
2026-03-08 13:00:06 +01:00
To install these for Linux run:
2025-07-17 14:30:20 +02:00
2025-05-02 12:47:23 +02:00
```bash
2025-12-03 15:45:56 +01:00
sudo apt-get install cmake build-essential python3-dev pkg-config libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libswresample-dev libavfilter-dev
2025-05-02 12:47:23 +02:00
```
2025-07-17 14:30:20 +02:00
2025-05-02 12:47:23 +02:00
For other systems, see: [Compiling PyAV](https://pyav.org/docs/develop/overview/installation.html#bring-your-own-ffmpeg)
2025-06-05 17:48:43 +02:00
## Optional dependencies
2026-03-08 13:00:06 +01:00
LeRobot provides optional extras for specific functionalities. Multiple extras can be combined (e.g., `.[aloha,feetech]`). For all available extras, refer to `pyproject.toml`. If you are using `uv`, replace `pip install` with `uv pip install` in the commands below.
2025-06-05 17:48:43 +02:00
### Simulations
2025-07-17 14:30:20 +02:00
2026-04-12 20:03:04 +02:00
Install environment packages: `aloha` ([gym-aloha](https://github.com/huggingface/gym-aloha)), or `pusht` ([gym-pusht](https://github.com/huggingface/gym-pusht)).
These automatically include the `dataset` extra.
2025-07-17 14:30:20 +02:00
2025-06-05 17:48:43 +02:00
```bash
pip install -e ".[aloha]" # or "[pusht]" for example
```
2025-05-02 12:47:23 +02:00
2025-06-05 17:48:43 +02:00
### Motor Control
2025-07-17 14:30:20 +02:00
2025-06-05 17:48:43 +02:00
For Koch v1.1 install the Dynamixel SDK, for SO100/SO101/Moss install the Feetech SDK.
2025-07-17 14:30:20 +02:00
2025-05-02 12:47:23 +02:00
```bash
2025-06-05 17:48:43 +02:00
pip install -e ".[feetech]" # or "[dynamixel]" for example
2025-05-02 12:47:23 +02:00
```
2025-06-05 17:48:43 +02:00
### Experiment Tracking
2025-07-17 14:30:20 +02:00
2026-04-12 20:03:04 +02:00
Weights and Biases is included in the `training` extra. To use [Weights and Biases](https://docs.wandb.ai/quickstart) for experiment tracking, log in with:
2025-07-17 14:30:20 +02:00
2025-05-02 12:47:23 +02:00
```bash
wandb login
```
2025-06-13 18:48:39 +02:00
You can now assemble your robot if it's not ready yet, look for your robot type on the left. Then follow the link below to use Lerobot with your robot.