@@ -24,29 +24,16 @@ export ISAACLAB_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && p
24
24
25
25
# extract isaac sim path
26
26
extract_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
29
31
# Use the python executable to get the path
30
- local python_exe=${CONDA_PREFIX} /bin/python
32
+ local python_exe=$( extract_python_exe )
31
33
# Retrieve the path importing isaac sim and getting the environment path
32
34
if [ $( ${python_exe} -m pip list | grep -c ' isaacsim-rl' ) ]; then
33
35
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=' '
46
36
fi
47
- else
48
- # Use the sym-link path to Isaac Sim directory
49
- local isaac_path=${ISAACLAB_PATH} /_isaac_sim
50
37
fi
51
38
# check if there is a path available
52
39
if [ ! -d " ${isaac_path} " ]; then
@@ -65,21 +52,22 @@ extract_isaacsim_path() {
65
52
66
53
# extract the python from isaacsim
67
54
extract_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
76
63
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
79
70
fi
80
- else
81
- # use python from kit
82
- local python_exe=${ISAACLAB_PATH} /_isaac_sim/python.sh
83
71
fi
84
72
# check if there is a python path available
85
73
if [ ! -f " ${python_exe} " ]; then
@@ -90,12 +78,6 @@ extract_python_exe() {
90
78
echo -e " \t3. Python executable is not available at the default path: ${ISAACLAB_PATH} /_isaac_sim/python.sh" >&2
91
79
exit 1
92
80
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
99
81
# return the result
100
82
echo ${python_exe}
101
83
}
@@ -300,8 +282,9 @@ while [[ $# -gt 0 ]]; do
300
282
# install the rl-frameworks specified
301
283
${python_exe} -m pip install -e ${ISAACLAB_PATH} /source/extensions/omni.isaac.lab_tasks[" ${framework_name} " ]
302
284
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
305
288
echo " [INFO] Running inside a docker container. Skipping VSCode settings setup."
306
289
echo " [INFO] To setup VSCode settings, run 'isaaclab -v'."
307
290
else
0 commit comments