LeRobot documentation

Installation

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Installation

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, then skip ahead to Environment Setup.

Step 1 ( conda only): Install miniforge

wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh

Step 2: Environment Setup

Create a virtual environment with Python 3.12:

conda
uv (PyTorch >= 2.10 only)
conda create -y -n lerobot python=3.12

Then activate your virtual environment, you have to do this each time you open a shell to use lerobot:

conda
uv (PyTorch >= 2.10 only)
conda activate lerobot

When installing LeRobot inside WSL (Windows Subsystem for Linux), make sure to also install evdev:

conda install evdev -c conda-forge

Platform requirements

On Apple Silicon, PyTorch requires macOS 14 or newer, and MPS acceleration macOS 15 or newer (on macOS 14, LeRobot falls back to CPU). On Linux, the default PyTorch wheels need an NVIDIA driver of 580.65 or newer; for older drivers, see PyTorch CUDA variant.

Install ffmpeg (for video decoding)

LeRobot uses TorchCodec for video decoding by default, which requires ffmpeg.

Platform support: TorchCodec is not available on macOS Intel (x86_64) or Linux armv7l. On these platforms, LeRobot automatically falls back to pyav — so you do not need to install ffmpeg and can skip to Step 3.

Jetson (aarch64 + CUDA): video decoding runs on CPU by default. docker/Dockerfile.jetson builds torch/torchcodec from source with CUDA support for JetPack 6.2 — community-maintained, see ravediamond/lerobot-jetson for the prebuilt image and issue #819 for background.

If your platform supports TorchCodec, install ffmpeg using one of the methods below:

conda (any PyTorch version)
uv (PyTorch >= 2.10 only)

Install ffmpeg in your conda environment. This works with all PyTorch versions and is required for PyTorch < 2.10:

conda install ffmpeg -c conda-forge

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:

conda install ffmpeg=7.1.1 -c conda-forge

Step 3: Install LeRobot 🤗

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.

From Source

First, clone the repository and navigate into the directory:

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.

conda
uv
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)

Installation from PyPI

Core Library: Install the base package with:

conda
uv
pip install lerobot

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.

ExtraWhat it addsTypical use case
datasetdatasets, av, torchcodec, jsonlinesLoading & creating datasets
trainingdataset + accelerate, trackioTraining policies
hardwarepynput, pyserial, deepdiffConnecting to real robots
vizrerun-sdk, foxglove-sdkVisualization during recording/eval

Composite Extras combine feature extras for common CLI scripts:

ExtraIncludesTypical use case
core_scriptsdataset + hardware + vizlerobot-record, lerobot-replay, lerobot-calibrate
evaluationavlerobot-eval (add policy + env extras as needed)
dataset_vizdataset + vizlerobot-dataset-viz, lerobot-imgtransform-viz
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

Policy, environment, and hardware extras are still available for specific dependencies:

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

Multiple extras can be combined (e.g., .[core_scripts,pi,pusht]). For a full list of available extras, refer to pyproject.toml.

PyTorch CUDA variant (Linux only)

On Linux, torch and torchvision come from PyPI, whose default wheels are CUDA 13 builds (driver floor 580.65). macOS and Windows installs use the PyPI default wheels and can skip this section.

For an older driver or GPU, install PyTorch from the matching PyTorch index first, then LeRobot. PyPI’s Linux TorchCodec is a CUDA 13 build too, so take it from the CPU index (with torch below 2.11, pick the matching release from the TorchCodec compatibility table):

pip install --index-url https://download.pytorch.org/whl/cu126 torch torchvision
pip install --index-url https://download.pytorch.org/whl/cpu torchcodec
pip install -e ".[all]"          # source
# — or —
pip install lerobot              # from PyPI

cu126 is the build PyTorch keeps for drivers that only support CUDA 12. torch 2.15 has no CUDA 12 build, so this index installs torch 2.14, and staying on CUDA 12 means staying on torch 2.14 or older.

With uv pip, --torch-backend selects the index in one step, e.g. uv pip install --torch-backend cu126 lerobot. uv sync always installs the committed lock: to change the CUDA build there, add the index to [tool.uv.index] and [tool.uv.sources] in pyproject.toml and re-run uv lock.

Troubleshooting

If you encounter build errors, you may need to install additional system dependencies: cmake, build-essential, and ffmpeg libs. To install these for Linux run:

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

For other systems, see: Compiling PyAV

Optional dependencies

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.

Simulations

Install environment packages: aloha (gym-aloha), pusht (gym-pusht), libero (Linux only) or metaworld. These automatically include the dataset extra.

pip install -e ".[aloha]" # or "[pusht]" for example

Motor Control

Install the extra for your motors: dynamixel for Koch v1.1, feetech for SO100/SO101/Moss. Both talk to the motors through rustypot.

pip install -e ".[feetech]" # or "[dynamixel]" for example

Experiment Tracking

Trackio is included in the training extra. Local runs need no account or login: they are stored in a local SQLite database under ~/.cache/huggingface/trackio. Open the dashboard with:

trackio show --project lerobot

To sync runs to a Hugging Face Space (created if missing), run hf auth login and pass --trackio.space_id=<user>/<space>. Remote jobs (--job.target) with tracking enabled require space_id, because the pod’s local database is lost when the job ends.

Space privacy defaults to None: new Spaces are public unless the organization’s default is private. Pass --trackio.private=true to create a private Space.

Each run records the command that launched it and its console output (prints, logs, tracebacks), both shown on the run’s page in the dashboard. On a Space they are as visible as the Space itself; pass --trackio.capture_console=false to keep the console output out of the run.

Migrating from Weights & Biases

W&B settingTrackio setting
--wandb.enable=true--trackio.enable=true
--wandb.project=<project>--trackio.project=<project>
--wandb.disable_artifact=trueAlready the default; use --trackio.disable_artifact=false to opt in
--wandb.entity=<team>Choose --trackio.space_id=<user-or-org>/<space> for hosted logging
--wandb.run_id=<id>Use --trackio.run_name=<name> for an existing Trackio run
--wandb.mode=offlineOmit space_id for local logging; also unset TRACKIO_SPACE_ID and TRACKIO_SERVER_URL if set
--wandb.mode=disabled--trackio.enable=false
--wandb.console=off--trackio.capture_console=false

Next steps

  • Have a robot? Assemble and calibrate it by following its page under Robots in the sidebar (for example SO-101), then record a dataset and train your first policy with the imitation learning tutorial.
  • No hardware yet? Train and evaluate a policy in simulation with LIBERO, or try the Colab notebooks.
  • Want to contribute? Read the contributing guide.
  • Keep the cheat sheet at hand: it lists every LeRobot command in one place.
Update on GitHub