Repository navigation
Conversation
|
I was blocked by not being able to specify the python path to ╰─$ 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) |
|
I agree with @rowoflo that the default should be the version based on isaacsim (that's what I had intended the default behavior to be). Thanks for this PR! I'm not sure if you need so much context in the help script, but the core change + default fixes the problem. |
|
@kellyguo11 with a little polish this should solve #3524 |
|
@KyleM73 |
| echo -e "\t Optionally specify a Python interpreter path to use for the environment." | ||
| echo -e "\nExamples:" | ||
| echo -e "\t 1. uv environment creation:" | ||
| echo -e "\t\t1.a create env_isaaclab with system python3" | ||
| echo -e "\t\t$(basename "$0") --uv" | ||
| echo -e "\t\t1.b create myenv with system python3" | ||
| echo -e "\t\t$(basename "$0") --uv myenv " | ||
| echo -e "\t\t1.c create myenv with specified Python 3.11" | ||
| echo -e "\t\t$(basename "$0") --uv myenv --python ${HOME}/isaacsim50/kit/python/bin/python3" |
There was a problem hiding this comment.
Maybe this should go to the docs instead of having it here? Or maybe more optional, i.e. printed only when uv --help is passed? Otherwise it becomes many things.
2ef7fc8 to
f3061a4
Compare
# Description This PR enhances the `isaaclab.sh` installation script to support flexible virtual environment workflows by allowing installation into existing uv/venv environments. ## Changes - **Environment Detection**: Detect and use active uv/venv/conda environments during installation - **Environment Display**: Show current environment path and Python executable when installing - **Smart Python Selection**: Auto-detect Isaac Sim version (4.5 vs 5.0+) and select appropriate Python version (3.10 vs 3.11) - **Improved UX**: Provide helpful hints when running `-u` with an active environment - **Compatibility Fix**: Fix tabs command error in non-interactive terminals ## Motivation Previously, users had to create a new environment in the IsaacLab directory. This PR enables modern Python workflows where users can: - Install Isaac Lab into project-specific virtual environments - Use `uv` project-based workflows - Manage multiple Isaac Lab installations in different environments The issue is mentioned in #3783 and #3560 ## Type of change - [x] New feature (non-breaking change which adds functionality) - [x] Documentation update (help text improvements) ## Testing Tested scenarios: - ✅ Installation in existing uv environment - ✅ Installation in existing conda environment - ✅ Creating new environment with `-u` flag - ✅ Environment switching between multiple installations - ✅ Script help output (`./isaaclab.sh -h`) ## Checklist - [x] I have run the `pre-commit` checks with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation (help text) - [x] My changes generate no new warnings - [x] Maintains backward compatibility with existing workflows --------- Co-authored-by: Liang,Yi <[email protected]>
Description
This PR directly addresses #3559.
Type of change
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there