Skip to content

Conversation

kwang-12
Copy link

@kwang-12 kwang-12 commented Sep 25, 2025

Description

This PR directly addresses #3559.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • 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
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@rowoflo
Copy link

rowoflo commented Oct 8, 2025

I was blocked by not being able to specify the python path to uv as well. I wrote a fix but then found this PR. The diff for my fix is below. You might want to use the portion that has it default to a given Python version based on the Isaac Sim version as stated here.

╰─$ git diff
diff --git a/isaaclab.sh b/isaaclab.sh
index 263ff88e8a..92f66eb9d3 100755
--- a/isaaclab.sh
+++ b/isaaclab.sh
@@ -496,7 +496,8 @@ print_help () {
     echo -e "\t-d, --docs           Build the documentation from source using sphinx."
     echo -e "\t-n, --new            Create a new external project or internal task from template."
     echo -e "\t-c, --conda [NAME]   Create the conda environment for Isaac Lab. Default name is 'env_isaaclab'."
-    echo -e "\t-u, --uv [NAME]      Create the uv environment for Isaac Lab. Default name is 'env_isaaclab'."
+    echo -e "\t-u, --uv [NAME] [PYTHON_PATH]  Create the uv environment for Isaac Lab. Default name is 'env_isaaclab'."
+    echo -e "\t                     Optional PYTHON_PATH: Python interpreter path (e.g., '3.11', 'python3.10', or '/usr/bin/python3.11')."
     echo -e "\n" >&2
 }

@@ -599,8 +600,25 @@ while [[ $# -gt 0 ]]; do
                 uv_env_name=$2
                 shift # past argument
             fi
+
+            # check if python path is provided
+            if [ -n "$2" ] && [[ "$2" != -* ]]; then
+                echo "[INFO] Using python interpreter: $2"
+                python_path="$2"
+                shift # past argument
+            else
+                # use default python version based on Isaac Sim version
+                if is_isaacsim_version_4_5; then
+                    echo "[INFO] Detected Isaac Sim 4.5 → using python 3.10"
+                    python_path="3.10"
+                else
+                    echo "[INFO] Using default python 3.11"
+                    python_path="3.11"
+                fi
+            fi
+
             # setup the uv environment for Isaac Lab
-            setup_uv_env ${uv_env_name}
+            setup_uv_env ${uv_env_name} ${python_path}
             shift # past argument
             ;;
         -f|--format)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure isaac-lab Related to Isaac Lab team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants