@@ -24,29 +24,16 @@ export ISAACLAB_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && p
2424
2525# extract isaac sim path
2626extract_isaacsim_path () {
27- # Check if we have pip package installed inside conda environment
28- if ! [[ -z " ${CONDA_PREFIX} " ]]; then
27+ # Use the sym-link path to Isaac Sim directory
28+ local isaac_path=${ISAACLAB_PATH} /_isaac_sim
29+ # If above path is not available, try to find the path using python
30+ if [ ! -d " ${isaac_path} " ]; then
2931 # Use the python executable to get the path
30- local python_exe=${CONDA_PREFIX} /bin/python
32+ local python_exe=$( extract_python_exe )
3133 # Retrieve the path importing isaac sim and getting the environment path
3234 if [ $( ${python_exe} -m pip list | grep -c ' isaacsim-rl' ) ]; then
3335 local isaac_path=$( ${python_exe} -c " import isaacsim; import os; print(os.environ['ISAAC_PATH'])" )
34- else
35- # If package not installed, try with the default path
36- local isaac_path=${ISAACLAB_PATH} /_isaac_sim
37- fi
38- elif command -v python & > /dev/null; then
39- # note: we need to deal with this case because of docker containers
40- # Retrieve the path importing isaac sim and getting the environment path
41- if [ $( python -m pip list | grep -c ' isaacsim-rl' ) ]; then
42- local isaac_path=$( python -c " import isaacsim; import os; print(os.environ['ISAAC_PATH'])" )
43- else
44- # If package not installed, use an empty path for failure
45- local isaac_path=' '
4636 fi
47- else
48- # Use the sym-link path to Isaac Sim directory
49- local isaac_path=${ISAACLAB_PATH} /_isaac_sim
5037 fi
5138 # check if there is a path available
5239 if [ ! -d " ${isaac_path} " ]; then
@@ -65,21 +52,22 @@ extract_isaacsim_path() {
6552
6653# extract the python from isaacsim
6754extract_python_exe () {
68- # check if using conda
69- if ! [[ -z " ${CONDA_PREFIX} " ]] ; then
70- # use conda python
71- local python_exe= ${CONDA_PREFIX} /bin/python
72- elif command -v python & > /dev/null ; then
73- # note: we need to deal with this case because of docker containers
74- if [ $( python -m pip list | grep -c ' isaacsim-rl ' ) ] ; then
75- local python_exe=$( which python)
55+ # default to python in the kit
56+ local python_exe= ${ISAACLAB_PATH} /_isaac_sim/python.sh
57+ # if default python is not available, check if conda is activated
58+ if [ ! -f " ${python_exe} " ] ; then
59+ # check if using conda
60+ if ! [[ -z " ${CONDA_PREFIX} " ]] ; then
61+ # use conda python
62+ local python_exe=${CONDA_PREFIX} /bin/ python
7663 else
77- # leave a blank path for failure
78- local python_exe=' '
64+ # note: we need to check system python for cases such as docker
65+ # inside docker, if user installed into system python, we need to use that
66+ # otherwise, use the python from the kit
67+ if [ $( python -m pip list | grep -c ' isaacsim-rl' ) ]; then
68+ local python_exe=$( which python)
69+ fi
7970 fi
80- else
81- # use python from kit
82- local python_exe=${ISAACLAB_PATH} /_isaac_sim/python.sh
8371 fi
8472 # check if there is a python path available
8573 if [ ! -f " ${python_exe} " ]; then
@@ -90,12 +78,6 @@ extract_python_exe() {
9078 echo -e " \t3. Python executable is not available at the default path: ${ISAACLAB_PATH} /_isaac_sim/python.sh" >&2
9179 exit 1
9280 fi
93- # kit dependencies are built with python 3.10 so any other version will not work
94- # this is needed in case users have multiple python versions installed and the wrong one is being used
95- if [ " $( ${python_exe} --version | grep -c ' 3.10' ) " -eq 0 ]; then
96- echo " [ERROR] Found Python version: $( ${python_exe} --version) while expecting 3.10. Please use the correct python version." >&2
97- exit 1
98- fi
9981 # return the result
10082 echo ${python_exe}
10183}
@@ -300,8 +282,9 @@ while [[ $# -gt 0 ]]; do
300282 # install the rl-frameworks specified
301283 ${python_exe} -m pip install -e ${ISAACLAB_PATH} /source/extensions/omni.isaac.lab_tasks[" ${framework_name} " ]
302284
303- # check if we are inside a docker container (in that case don't setup VSCode)
304- if [ -f " /.dockerenv" ]; then
285+ # check if we are inside a docker container or are building a docker image
286+ # in that case don't setup VSCode since it asks for EULA agreement which triggers user interaction
287+ if [ -f /.dockerenv ]; then
305288 echo " [INFO] Running inside a docker container. Skipping VSCode settings setup."
306289 echo " [INFO] To setup VSCode settings, run 'isaaclab -v'."
307290 else
0 commit comments