Skip to content

How to Install MuJoCo and LeRobot: Matching Versions by OS, With or Without a GPU

Set up MuJoCo 3.16.0 and LeRobot 0.6.1 in one Python 3.12 environment: per-OS wheel support, CUDA driver floors, headless rendering with MUJOCO_GL, and no-GPU options.

Contents

Key takeaways

  1. MuJoCo 3.16.0 requires Python 3.10 or newer and LeRobot 0.6.1 requires Python 3.12 or newer, so a Python 3.12 environment is the simplest version that satisfies both.
  2. The MuJoCo 3.16.0 release only ships arm64 wheels for macOS, so Intel Macs get no prebuilt wheel.
  3. On Linux the default PyPI torch wheel is built against CUDA 13.0 and needs NVIDIA driver 580.65 or newer; with an older driver, install torch first from the cu128 index (driver 570.86+) or cu126.
  4. Headless servers need MUJOCO_GL=egl (GPU) or osmesa (CPU software rendering); glfw does not work without a display.
  5. Without a GPU you can use the CPU, Apple MPS or Colab, but free Colab sessions run for at most 12 hours and usage limits and GPU types are not published or guaranteed.

When you start with robot simulation and imitation learning, the first thing that breaks is usually not the model but the install. MuJoCo and LeRobot require different Python versions, and PyTorch’s CUDA build, your graphics driver and the rendering backend all have to line up. One mismatch is enough to stop you at import. This guide installs both packages into one environment using only the official documentation and PyPI release metadata as of October 22, 2026. By the end you will know which combination fits your OS and GPU and how to confirm that the install actually works.

If you have not picked a simulator yet, read the MuJoCo vs Isaac Lab vs PyBullet vs Genesis comparison first.

Match the versions both packages require

The mujoco page on PyPI lists 3.16.0, uploaded on October 14, 2026, with Requires-Python set to 3.10 or newer. The lerobot page on PyPI lists 0.6.1, uploaded on August 3, 2026, which requires Python 3.12 or newer and declares torch>=2.7,<2.12 as a dependency. The lowest version that satisfies both is 3.12, so this guide uses Python 3.12 throughout.

ItemMuJoCo 3.16.0LeRobot 0.6.1
Python3.10+ (wheels for 3.10 to 3.15)3.12+
Linuxx86_64 and aarch64 wheels (manylinux_2_27/2_28)No TorchCodec on aarch64; falls back to pyav automatically
macOSarm64 wheels only (macOS 11+)Apple silicon uses MPS; no TorchCodec on Intel Macs
Windowswin_amd64 wheelsNo TorchCodec with PyTorch below 2.8
PyTorchNot a dependencytorch>=2.7,<2.12

The table combines each package’s release file list with the platform notes in the LeRobot installation guide. The MuJoCo wheel bundles the MuJoCo library itself, so, as the MuJoCo Python docs put it, pip install mujoco is all you need; there is no separate binary to download. The flip side is that 3.16.0 only ships arm64 wheels for macOS, so an Intel Mac would need a source build.

On Linux, match the CUDA driver to the torch build

If you plan to train on a GPU, check your driver version with nvidia-smi before installing anything. According to the LeRobot installation guide, the default torch wheel on PyPI for Linux is built against CUDA 13.0 and has a driver floor of 580.65. With an older driver, install torch first, from an explicit index, before installing lerobot.

torch indexDriver floor (per the docs)When to pick it
PyPI default (cu130)580.65Recent driver; no index needed
cu128570.86Ampere, Ada, Hopper or Blackwell with a driver below 580
cu126Described only as “older drivers”Anything older than that

macOS and Windows use the default PyPI wheel (MPS and the Windows CUDA build, respectively), so you can skip this step there.

Install order: from environment to check script

The steps below use conda via miniforge. That is the approach the LeRobot docs recommend, and getting ffmpeg from conda-forge works with every PyTorch version.

  1. Create and activate a Python 3.12 environment.
  2. On Linux with NVIDIA, install torch first from the index that matches your driver.
  3. On platforms that support TorchCodec, install ffmpeg from conda-forge. Intel Macs and Linux ARM fall back to pyav, so you can skip it there.
  4. Install LeRobot with the extras you need, then install MuJoCo.
  5. Run a check script that tests all three packages and the accelerator in one go.
conda create -y -n physai python=3.12
conda activate physai

# (Linux + NVIDIA, only if your driver is below 580.65) install torch first
pip install --index-url https://download.pytorch.org/whl/cu128 torch torchvision

conda install ffmpeg -c conda-forge
pip install 'lerobot[training]' mujoco

Inside WSL, add conda install evdev -c conda-forge as the docs instruct. The base lerobot package is intentionally lightweight: recording and calibration need the core_scripts extra, training needs training, SmolVLA needs smolvla, and the Pi0 family needs pi.

Once the install finishes, save the following as check_env.py and run it.

from importlib.metadata import version

import mujoco
import torch

xml = """
<mujoco>
  <worldbody>
    <body pos="0 0 1">
      <freejoint/>
      <geom type="box" size=".05 .05 .05"/>
    </body>
  </worldbody>
</mujoco>
"""
m = mujoco.MjModel.from_xml_string(xml)
d = mujoco.MjData(m)
for _ in range(200):
    mujoco.mj_step(m, d)

print("mujoco", mujoco.__version__, "box z:", round(float(d.qpos[2]), 3))
print("lerobot", version("lerobot"))
print("torch", torch.__version__,
      "cuda:", torch.cuda.is_available(),
      "mps:", torch.backends.mps.is_available())

If the box height z comes out below its starting value of 1, gravity was applied and the physics steps ran. Then check that whichever of cuda or mps applies to your machine reads True.

Pick a rendering backend for servers without a display

MuJoCo’s OpenGL rendering runs on one of three backends. The dm_control README says they are tried in the order GLFW, EGL, OSMesa, and that you can pin one with the MUJOCO_GL environment variable.

MUJOCO_GLModeRequirementsGood fit
glfwWindowed, hardware-acceleratedA display, GLFW and GLEWLocal desktop, interactive viewer
eglHeadless, hardware-acceleratedA driver supporting EXT_platform_device (recent NVIDIA drivers)GPU servers, cloud training
osmesaHeadless, software renderingGLX and OSMesa librariesServers without a GPU (slow)

On multi-GPU machines, MUJOCO_EGL_DEVICE_ID selects the GPU used for rendering. To confirm the backend is picked up, create a mujoco.GLContext, which the MuJoCo Python docs describe for offscreen rendering.

export MUJOCO_GL=egl
python -c "import mujoco; ctx = mujoco.GLContext(640, 480); ctx.make_current(); print('GL context OK')"

Local macOS has a different catch when you use the interactive viewer. Per the docs, mujoco.viewer.launch_passive must run under the mjpython launcher on macOS, and mjpython is installed with the mujoco package. Run mjpython my_script.py instead of python my_script.py.

Options and limits when you have no GPU

You can install everything and run simulations without a GPU. MuJoCo physics runs on the CPU, and the check script above finishes without one. Policy training is where you hit the limit.

OptionWhat you can doLimits
CPU onlyInstall, simulate, inspect datasets, short runs of small policiesImage-based policy training is far slower than on a GPU
Apple silicon (MPS)Train and run with policy.device=mpsFeatures that need CUDA-only kernels are unavailable
Free Google ColabRun GPU training notebooks in the browserSessions of at most 12 hours; GPU types and usage limits not published

The Colab FAQ says notebooks on the free tier can run for at most 12 hours, depending on availability and usage patterns, and that usage limits fluctuate and are not published. When training on Colab, save checkpoints to the Hugging Face Hub or Drive often so you can resume after a disconnect. LeRobot links Colab training notebooks for ACT and SmolVLA from their respective docs pages.

How much GPU memory training needs varies a lot by model. The SmolVLA case is worked through in How Much GPU Memory Does SmolVLA Fine-Tuning Need?

Pin the environment so you can rebuild it

Once an install works, writing the versions down is the cheapest way to avoid the next breakage. The environment.yml below pins the reference versions used in this guide.

name: physai
channels:
  - conda-forge
dependencies:
  - python=3.12
  - ffmpeg
  - pip
  - pip:
      - mujoco==3.16.0
      - lerobot[training]==0.6.1

If you installed torch from a specific index on Linux, document that step in your README so it runs before conda env create -f environment.yml. To capture everything that actually got installed, run pip freeze > requirements.lock.txt; a teammate can then reproduce the exact same combination.

Where to look first when the install fails

SymptomCauseFirst fix
Python version error while installing lerobotPython 3.10 or 3.11 environmentCreate a new Python 3.12 environment
torch.cuda.is_available() returns FalseDriver below the floor of the default wheel (cu130)Reinstall torch from the cu128 or cu126 index
PyAV build errorsMissing ffmpeg development librariesInstall the apt-get install cmake build-essential ... libavformat-dev list from the docs
GLFW errors on a headless serverglfw, first in the default order, looks for a displaySet MUJOCO_GL=egl
EGL initialization failsDriver lacks the EGL device extension, or no GPU accessCheck the driver; fall back to MUJOCO_GL=osmesa for now
Viewer error on macOSlaunch_passive started with pythonStart it with mjpython

With the install done, you can move straight to collecting SO-101 data and training ACT with LeRobot to validate your data pipeline. Which policy to start with, given how much data you have, is covered in Is 50 Demos Enough to Fine-Tune a VLA?.

Common mistakes

  • Installing into the system Python (3.10 or 3.11), where LeRobot refuses to install because of its Python requirement
  • Installing lerobot on Linux without choosing a torch build, then finding torch.cuda.is_available() returns False because the driver is older than 580.65
  • Leaving MUJOCO_GL unset on a remote server, so glfw, the first backend tried, fails looking for a display
  • Running mujoco.viewer.launch_passive with python on macOS — it must be launched with mjpython

Pre-flight checklist

  • python –version reports 3.12.x inside the environment you install into
  • On Linux with NVIDIA, the driver from nvidia-smi meets the floor of the torch index you picked (cu126, cu128 or cu130)
  • On platforms that support TorchCodec, ffmpeg is installed from conda-forge
  • On headless servers, MUJOCO_GL is pinned in the shell or conda environment
  • The check script prints the expected mujoco, torch and lerobot versions and the CUDA/MPS availability you expect

Frequently asked questions

Can I use uv instead of conda?
The LeRobot installation guide covers uv as well. Note that letting TorchCodec link a system-wide ffmpeg is only supported with PyTorch 2.10 or newer (TorchCodec 0.10 or newer); with older PyTorch you need ffmpeg from conda-forge.
When do I need to build MuJoCo from source?
When there is no official wheel for your platform or you need to modify MuJoCo itself. The MuJoCo docs say a source build needs CMake, a C++17 compiler, a MuJoCo library build or binary release, and the MUJOCO_PATH environment variable.
Should I use WSL2 or native Windows?
MuJoCo 3.16.0 ships a win_amd64 wheel, so a native install works. The LeRobot docs ask you to install evdev when installing inside WSL, which matters if you plan to connect real robot input devices.

Sources & verification

  1. PyPI — mujoco (3.16.0 release files, Requires-Python)
  2. MuJoCo Documentation — Python Bindings
  3. Hugging Face LeRobot Docs — Installation
  4. PyPI — lerobot (0.6.1 Requires-Python, dependencies)
  5. Google DeepMind dm_control README — Rendering (MUJOCO_GL)
  6. Google Colab FAQ — free-tier resource limits

Last verified: