[MicroDuck RL 03] Complete Environment Setup Guide

MicroDuck RL: From Simulation to the Real Robot — Part 03 of 14

This part walks through the complete training-environment setup from scratch. It takes about ten minutes, most of which is spent waiting for dependencies to download, and includes the issues we encountered along the way.

Hardware and Prerequisite Checks

nvidia-smi          # A CUDA-capable GPU is required. Tested on an RTX 5080 16 GB.
python3 --version   # Your system Python version does not matter; uv manages its own interpreter.

The repository requires Python 3.12.x because the bam dependency is not yet compatible with Python 3.13. Our test machine had Python 3.13.5 installed system-wide, but that was not a problem: uv automatically downloaded and used a managed Python 3.12 interpreter. This issue also appears in the FAQ.

Install uv

uv is a Python package and environment manager. You can use the official installer, or install it with pip if your environment restricts remote installation scripts:

pip install uv      # Our test installed uv 0.12.9.

Think of uv as a fast replacement for pip, virtual environments, and Python-version management. uv sync reads pyproject.toml and uv.lock, creates .venv, and installs the exact locked dependencies. uv run COMMAND runs a command inside that environment.

Clone the Repository and Sync Dependencies

git clone https://github.com/pollen-robotics/microduck_rl
cd microduck_rl
uv sync               # First run: about 6 minutes and roughly 2 GB of downloads,
                      # mostly the CUDA build of PyTorch.

Key installed dependencies:

Package Version Purpose
torch 2.9.1+cu128 Deep-learning framework; the x86_64 PyPI wheel includes CUDA
warp-lang 1.12.0 NVIDIA Warp, the GPU-kernel framework used by MuJoCo Warp
mjlab 1.3.0 Training framework
rsl-rl-lib 5.0.1 PPO implementation
better-actuator-models Git branch mjlab_frictionloss BAM actuator model, imported as bam
tensorboard / wandb 2.20.0 / 0.24.0 Training visualization and logging

Verify the Environment in Three Steps

# 1) Confirm that PyTorch can see the GPU.
uv run python -c "import torch; print(torch.cuda.is_available())"   # True

# 2) Confirm that the tasks are registered.
uv run list-envs      # Should list all tasks, including the MicroDuck tasks.

# 3) Run the repository test suite.
uv run --with pytest pytest tests/    # 166 passed, 1 skipped

The skipped test is specific to aarch64 (ARM) and is expected to be skipped on x86_64.

If all three checks pass, your environment is ready. Part 04 starts training with a single command and explains exactly what happens behind it.