Skip to content

Commit d5d5711

Browse files
KyleM73Mayankm96
andauthored
Adds uv support as an alternative to conda in isaaclab.sh (#3172)
# Description This PR adds support for uv as an alternative to conda or venv for managing virtual environments and adds corresponding support for uv pip for managing python dependencies. uv and uv pip is significantly faster than conda and has many useful tools. If users wish to use the uv workflow they will need to have uv installed, but otherwise no additional dependencies are added. Docs should be updated to describe this option. There may need to be more work done to clean when deactivating the environment. Uv does not support pre and post activation hooks like conda so cleaning up the environment variables is slightly more tricky. I would greatly appreciate feedback to improve this workflow! Fixes #3408 ## Type of change - New feature (non-breaking change which adds functionality) - This change requires a documentation update ## Checklist - [X] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [X] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [X] I have added my name to the `CONTRIBUTORS.md` or my name already exists there --------- Signed-off-by: Kyle Morgenstein <[email protected]> Signed-off-by: Mayank Mittal <[email protected]> Co-authored-by: Mayank Mittal <[email protected]>
1 parent 9e327f2 commit d5d5711

File tree

9 files changed

+310
-29
lines changed

9 files changed

+310
-29
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Astral Software Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

docs/source/overview/developer-guide/vs_code.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ python executable provided by Omniverse. This is specified in the
6969
"python.defaultInterpreterPath": "${workspaceFolder}/_isaac_sim/python.sh",
7070
}
7171
72-
If you want to use a different python interpreter (for instance, from your conda environment),
72+
If you want to use a different python interpreter (for instance, from your conda or uv environment),
7373
you need to change the python interpreter used by selecting and activating the python interpreter
7474
of your choice in the bottom left corner of VSCode, or opening the command palette (``Ctrl+Shift+P``)
7575
and selecting ``Python: Select Interpreter``.

docs/source/overview/own-project/template.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Running the template generator
3333
------------------------------
3434

3535
Install Isaac Lab by following the `installation guide <../../setup/installation/index.html>`_.
36-
We recommend using conda installation as it simplifies calling Python scripts from the terminal.
36+
We recommend using conda or uv installation as it simplifies calling Python scripts from the terminal.
3737

3838
Then, run the following command to generate a new external project or internal task:
3939

docs/source/setup/installation/binaries_installation.rst

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ Clone the Isaac Lab repository into your workspace:
213213
-d, --docs Build the documentation from source using sphinx.
214214
-n, --new Create a new external project or internal task from template.
215215
-c, --conda [NAME] Create the conda environment for Isaac Lab. Default name is 'env_isaaclab'.
216+
-u, --uv [NAME] Create the uv environment for Isaac Lab. Default name is 'env_isaaclab'.
216217
217218
.. tab-item:: :icon:`fa-brands fa-windows` Windows
218219
:sync: windows
@@ -234,6 +235,7 @@ Clone the Isaac Lab repository into your workspace:
234235
-d, --docs Build the documentation from source using sphinx.
235236
-n, --new Create a new external project or internal task from template.
236237
-c, --conda [NAME] Create the conda environment for Isaac Lab. Default name is 'env_isaaclab'.
238+
-u, --uv [NAME] Create the uv environment for Isaac Lab. Default name is 'env_isaaclab'.
237239
238240
239241
Creating the Isaac Sim Symbolic Link
@@ -268,6 +270,57 @@ to index the python modules and look for extensions shipped with Isaac Sim.
268270
mklink /D _isaac_sim path_to_isaac_sim
269271
:: For example: mklink /D _isaac_sim C:/isaacsim
270272
273+
Setting up the uv environment (optional)
274+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
275+
276+
.. attention::
277+
This step is optional. If you are using the bundled python with Isaac Sim, you can skip this step.
278+
279+
The executable ``isaaclab.sh`` automatically fetches the python bundled with Isaac
280+
Sim, using ``./isaaclab.sh -p`` command (unless inside a virtual environment). This executable
281+
behaves like a python executable, and can be used to run any python script or
282+
module with the simulator. For more information, please refer to the
283+
`documentation <https://docs.isaacsim.omniverse.nvidia.com/latest/python_scripting/manual_standalone_python.html>`__.
284+
285+
To install ``uv``, please follow the instructions `here <https://docs.astral.sh/uv/getting-started/installation/>`__.
286+
You can create the Isaac Lab environment using the following commands.
287+
288+
.. tab-set::
289+
:sync-group: os
290+
291+
.. tab-item:: :icon:`fa-brands fa-linux` Linux
292+
:sync: linux
293+
294+
.. code:: bash
295+
296+
# Option 1: Default name for uv environment is 'env_isaaclab'
297+
./isaaclab.sh --uv # or "./isaaclab.sh -u"
298+
# Option 2: Custom name for uv environment
299+
./isaaclab.sh --uv my_env # or "./isaaclab.sh -u my_env"
300+
301+
.. tab-item:: :icon:`fa-brands fa-windows` Windows
302+
:sync: windows
303+
304+
.. code:: batch
305+
306+
:: Option 1: Default name for uv environment is 'env_isaaclab'
307+
isaaclab.bat --uv :: or "isaaclab.bat -u"
308+
:: Option 2: Custom name for uv environment
309+
isaaclab.bat --uv my_env :: or "isaaclab.bat -u my_env"
310+
311+
312+
Once created, be sure to activate the environment before proceeding!
313+
314+
.. code:: bash
315+
316+
source ./env_isaaclab/bin/activate # or "source ./my_env/bin/activate"
317+
318+
Once you are in the virtual environment, you do not need to use ``./isaaclab.sh -p`` / ``isaaclab.bat -p``
319+
to run python scripts. You can use the default python executable in your environment
320+
by running ``python`` or ``python3``. However, for the rest of the documentation,
321+
we will assume that you are using ``./isaaclab.sh -p`` / ``isaaclab.bat -p`` to run python scripts. This command
322+
is equivalent to running ``python`` or ``python3`` in your virtual environment.
323+
271324

272325
Setting up the conda environment (optional)
273326
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -427,8 +480,8 @@ On Windows machines, please terminate the process from Command Prompt using
427480

428481
If you see this, then the installation was successful! |:tada:|
429482

430-
If you see an error ``ModuleNotFoundError: No module named 'isaacsim'``, ensure that the conda environment is activated
431-
and ``source _isaac_sim/setup_conda_env.sh`` has been executed.
483+
If you see an error ``ModuleNotFoundError: No module named 'isaacsim'``, ensure that the conda or uv environment is activated
484+
and ``source _isaac_sim/setup_conda_env.sh`` has been executed (for uv as well).
432485

433486

434487
Train a robot!

docs/source/setup/installation/isaaclab_pip_installation.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,31 @@ To learn about how to set up your own project on top of Isaac Lab, see :ref:`tem
2525
conda create -n env_isaaclab python=3.11
2626
conda activate env_isaaclab
2727
28+
.. tab-item:: uv environment
29+
30+
.. tab-set::
31+
:sync-group: os
32+
33+
.. tab-item:: :icon:`fa-brands fa-linux` Linux
34+
:sync: linux
35+
36+
.. code-block:: bash
37+
38+
# create a virtual environment named env_isaaclab with python3.11
39+
uv venv --python 3.11 env_isaaclab
40+
# activate the virtual environment
41+
source env_isaaclab/bin/activate
42+
43+
.. tab-item:: :icon:`fa-brands fa-windows` Windows
44+
:sync: windows
45+
46+
.. code-block:: batch
47+
48+
# create a virtual environment named env_isaaclab with python3.11
49+
uv venv --python 3.11 env_isaaclab
50+
# activate the virtual environment
51+
env_isaaclab\Scripts\activate
52+
2853
.. tab-item:: venv environment
2954

3055
.. tab-set::
@@ -70,6 +95,10 @@ To learn about how to set up your own project on top of Isaac Lab, see :ref:`tem
7095
7196
python -m pip install --upgrade pip
7297
98+
.. note::
99+
100+
If you use uv, replace ``pip`` with ``uv pip``.
101+
73102

74103
- Next, install a CUDA-enabled PyTorch 2.7.0 build for CUDA 12.8.
75104

docs/source/setup/installation/pip_installation.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,31 @@ If you encounter any issues, please report them to the
4949
conda create -n env_isaaclab python=3.11
5050
conda activate env_isaaclab
5151
52+
.. tab-item:: uv environment
53+
54+
.. tab-set::
55+
:sync-group: os
56+
57+
.. tab-item:: :icon:`fa-brands fa-linux` Linux
58+
:sync: linux
59+
60+
.. code-block:: bash
61+
62+
# create a virtual environment named env_isaaclab with python3.11
63+
uv venv --python 3.11 env_isaaclab
64+
# activate the virtual environment
65+
source env_isaaclab/bin/activate
66+
67+
.. tab-item:: :icon:`fa-brands fa-windows` Windows
68+
:sync: windows
69+
70+
.. code-block:: batch
71+
72+
# create a virtual environment named env_isaaclab with python3.11
73+
uv venv --python 3.11 env_isaaclab
74+
# activate the virtual environment
75+
env_isaaclab\Scripts\activate
76+
5277
.. tab-item:: venv environment
5378

5479
.. tab-set::
@@ -94,6 +119,9 @@ If you encounter any issues, please report them to the
94119
95120
python -m pip install --upgrade pip
96121
122+
.. note::
123+
124+
If you use uv, replace ``pip`` with ``uv pip``.
97125

98126
- Next, install a CUDA-enabled PyTorch 2.7.0 build.
99127

@@ -216,6 +244,7 @@ Clone the Isaac Lab repository into your workspace:
216244
-d, --docs Build the documentation from source using sphinx.
217245
-n, --new Create a new external project or internal task from template.
218246
-c, --conda [NAME] Create the conda environment for Isaac Lab. Default name is 'env_isaaclab'.
247+
-u, --uv [NAME] Create the uv environment for Isaac Lab. Default name is 'env_isaaclab'.
219248
220249
.. tab-item:: :icon:`fa-brands fa-windows` Windows
221250
:sync: windows
@@ -237,6 +266,7 @@ Clone the Isaac Lab repository into your workspace:
237266
-d, --docs Build the documentation from source using sphinx.
238267
-n, --new Create a new external project or internal task from template.
239268
-c, --conda [NAME] Create the conda environment for Isaac Lab. Default name is 'env_isaaclab'.
269+
-u, --uv [NAME] Create the uv environment for Isaac Lab. Default name is 'env_isaaclab'.
240270
241271
Installation
242272
~~~~~~~~~~~~

docs/source/setup/quickstart.rst

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,41 @@ pip install route using virtual environments.
2929

3030
To begin, we first define our virtual environment.
3131

32+
.. tab-set::
3233

33-
.. code-block:: bash
34+
.. tab-item:: conda
35+
36+
.. code-block:: bash
37+
38+
# create a virtual environment named env_isaaclab with python3.11
39+
conda create -n env_isaaclab python=3.11
40+
# activate the virtual environment
41+
conda activate env_isaaclab
42+
43+
.. tab-item:: uv
44+
45+
.. tab-set::
46+
:sync-group: os
47+
48+
.. tab-item:: :icon:`fa-brands fa-linux` Linux
49+
:sync: linux
50+
51+
.. code-block:: bash
52+
53+
# create a virtual environment named env_isaaclab with python3.11
54+
uv venv --python 3.11 env_isaaclab
55+
# activate the virtual environment
56+
source env_isaaclab/bin/activate
57+
58+
.. tab-item:: :icon:`fa-brands fa-windows` Windows
59+
:sync: windows
60+
61+
.. code-block:: batch
3462
35-
# create a virtual environment named env_isaaclab with python3.11
36-
conda create -n env_isaaclab python=3.11
37-
# activate the virtual environment
38-
conda activate env_isaaclab
63+
# create a virtual environment named env_isaaclab with python3.11
64+
uv venv --python 3.11 env_isaaclab
65+
# activate the virtual environment
66+
env_isaaclab\Scripts\activate
3967
4068
4169
Next, install a CUDA-enabled PyTorch 2.7.0 build.

0 commit comments

Comments
 (0)