mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-25 13:40:00 +00:00
chore(docs): add uv installation instructions (#3105)
* chore(docs): add uv installation instructions * fix(docs): format tabs * chore(docs): small details * chore(docs): last details uv installation instructions * chore(docs): last detail --- Co-authored-by: sahilmaniyar888 <156301258+sahilmaniyar888@users.noreply.github.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
This guide uses conda (via miniforge) to manage environments. If you prefer another environment manager (e.g. `uv`, `venv`), ensure you have Python >=3.12 and ffmpeg installed with the `libsvtav1` encoder, then skip ahead to [Install LeRobot](#step-3-install-lerobot-).
|
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 `ffmpeg` installed with the `libsvtav1` encoder, then skip ahead to [Environment Setup](#step-2-environment-setup).
|
||||||
|
|
||||||
## Step 1: Install [`miniforge`](https://conda-forge.org/download/)
|
## Step 1 (`conda` only): Install [`miniforge`](https://conda-forge.org/download/)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
|
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
|
||||||
@@ -11,22 +11,47 @@ bash Miniforge3-$(uname)-$(uname -m).sh
|
|||||||
|
|
||||||
## Step 2: Environment Setup
|
## Step 2: Environment Setup
|
||||||
|
|
||||||
Create a virtual environment with Python 3.12, using conda:
|
Create a virtual environment with Python 3.12:
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
<hfoptions id="create_venv">
|
||||||
|
<hfoption id="conda">
|
||||||
```bash
|
```bash
|
||||||
conda create -y -n lerobot python=3.12
|
conda create -y -n lerobot python=3.12
|
||||||
```
|
```
|
||||||
|
</hfoption>
|
||||||
Then activate your conda environment, you have to do this each time you open a shell to use lerobot:
|
<hfoption id="uv">
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
conda activate lerobot
|
uv python install 3.12
|
||||||
|
uv venv --python 3.12
|
||||||
```
|
```
|
||||||
|
</hfoption>
|
||||||
|
</hfoptions>
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
|
||||||
|
Then activate your virtual environment, you have to do this each time you open a shell to use lerobot:
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
<hfoptions id="activate_venv">
|
||||||
|
<hfoption id="conda">```bash
|
||||||
|
conda activate lerobot
|
||||||
|
```</hfoption>
|
||||||
|
<hfoption id="uv">
|
||||||
|
```bash
|
||||||
|
# Linux/macOSsource
|
||||||
|
source .venv/bin/activate
|
||||||
|
# Windows PowerShell
|
||||||
|
source .venv\Scripts\Activate.ps1
|
||||||
|
```
|
||||||
|
</hfoption>
|
||||||
|
</hfoptions>
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
|
||||||
When using `conda`, install `ffmpeg` in your environment:
|
When using `conda`, install `ffmpeg` in your environment:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
conda install ffmpeg -c conda-forge
|
conda install ffmpeg -c conda-forge
|
||||||
|
ffmpeg -version # ffmpeg 8.X is not yet supported !
|
||||||
```
|
```
|
||||||
|
|
||||||
> [!TIP]
|
> [!TIP]
|
||||||
@@ -47,6 +72,9 @@ conda install ffmpeg -c conda-forge
|
|||||||
> conda install evdev -c conda-forge
|
> conda install evdev -c conda-forge
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
|
> [!IMPORTANT]
|
||||||
|
> If you are using `uv` you will have to install `ffmpeg` system-wide (outside of the virtual environment). You rely on `uv` and `torchcodec` ability to dynamically link to the system `ffmpeg`.
|
||||||
|
|
||||||
## Step 3: Install LeRobot 🤗
|
## Step 3: Install LeRobot 🤗
|
||||||
|
|
||||||
### From Source
|
### From Source
|
||||||
@@ -60,23 +88,45 @@ cd lerobot
|
|||||||
|
|
||||||
Then, install the library in editable mode. This is useful if you plan to contribute to the code.
|
Then, install the library in editable mode. This is useful if you plan to contribute to the code.
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
<hfoptions id="install_lerobot_src">
|
||||||
|
<hfoption id="conda">
|
||||||
```bash
|
```bash
|
||||||
pip install -e .
|
pip install -e .
|
||||||
```
|
```
|
||||||
|
</hfoption>
|
||||||
|
<hfoption id="uv">
|
||||||
|
```bash
|
||||||
|
uv pip install -e .
|
||||||
|
```
|
||||||
|
</hfoption>
|
||||||
|
</hfoptions>
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
|
||||||
### Installation from PyPI
|
### Installation from PyPI
|
||||||
|
|
||||||
**Core Library:**
|
**Core Library:**
|
||||||
Install the base package with:
|
Install the base package with:
|
||||||
|
|
||||||
|
<!-- prettier-ignore-start -->
|
||||||
|
<hfoptions id="install_lerobot_pypi">
|
||||||
|
<hfoption id="conda">
|
||||||
```bash
|
```bash
|
||||||
pip install lerobot
|
pip install lerobot
|
||||||
```
|
```
|
||||||
|
</hfoption>
|
||||||
|
<hfoption id="uv">
|
||||||
|
```bash
|
||||||
|
uv pip install lerobot
|
||||||
|
```
|
||||||
|
</hfoption>
|
||||||
|
</hfoptions>
|
||||||
|
<!-- prettier-ignore-end -->
|
||||||
|
|
||||||
_This installs only the default dependencies._
|
_This installs only the default dependencies._
|
||||||
|
|
||||||
**Extra Features:**
|
**Extra Features:**
|
||||||
To install additional functionality, use one of the following:
|
To install additional functionality, use one of the following (If you are using `uv`, replace `pip install` with `uv pip install` in the commands below.):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install 'lerobot[all]' # All available features
|
pip install 'lerobot[all]' # All available features
|
||||||
@@ -93,7 +143,7 @@ https://pypi.org/project/lerobot/
|
|||||||
### Troubleshooting
|
### Troubleshooting
|
||||||
|
|
||||||
If you encounter build errors, you may need to install additional dependencies: `cmake`, `build-essential`, and `ffmpeg libs`.
|
If you encounter build errors, you may need to install additional dependencies: `cmake`, `build-essential`, and `ffmpeg libs`.
|
||||||
To install these for linux run:
|
To install these for Linux run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
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
|
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
|
||||||
@@ -103,7 +153,7 @@ For other systems, see: [Compiling PyAV](https://pyav.org/docs/develop/overview/
|
|||||||
|
|
||||||
## Optional dependencies
|
## 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`.
|
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
|
### Simulations
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user