Skip to content

Commit

Permalink
Fixes conda installation using isaaclab.sh script (#651)
Browse files Browse the repository at this point in the history
# Description

Fixes Isaac Lab conda installation  

## Type of change

- Bug fix (non-breaking change which fixes an issue)

## Checklist

- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [ ] 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
  • Loading branch information
Dhoeller19 committed Jul 6, 2024
1 parent 26a81a6 commit b1be6bb
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions isaaclab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ extract_isaacsim_path() {

# extract the python from isaacsim
extract_python_exe() {
# default to python in the kit
local python_exe=${ISAACLAB_PATH}/_isaac_sim/python.sh
# if default python is not available, check if conda is activated
# check if using conda
if ! [[ -z "${CONDA_PREFIX}" ]]; then
# use conda python
local python_exe=${CONDA_PREFIX}/bin/python
else
# use kit python
local python_exe=${ISAACLAB_PATH}/_isaac_sim/python.sh

if [ ! -f "${python_exe}" ]; then
# check if using conda
if ! [[ -z "${CONDA_PREFIX}" ]]; then
# use conda python
local python_exe=${CONDA_PREFIX}/bin/python
else
# note: we need to check system python for cases such as docker
# inside docker, if user installed into system python, we need to use that
# otherwise, use the python from the kit
Expand Down Expand Up @@ -153,9 +153,10 @@ setup_conda_env() {
# check if we have _isaac_sim directory -> if so that means binaries were installed.
# we need to setup conda variables to load the binaries
local isaacsim_setup_conda_env_script=${ISAACLAB_PATH}/_isaac_sim/setup_conda_env.sh

if [ -f "${isaacsim_setup_conda_env_script}" ]; then
# add variables to environment during activation
printf '' \
printf '%s\n' \
'# for Isaac Sim' \
'source '${isaacsim_setup_conda_env_script}'' \
'' >> ${CONDA_PREFIX}/etc/conda/activate.d/setenv.sh
Expand All @@ -182,7 +183,7 @@ setup_conda_env() {
# check if we have _isaac_sim directory -> if so that means binaries were installed.
if [ -f "${isaacsim_setup_conda_env_script}" ]; then
# add variables to environment during activation
printf '' \
printf '%s\n' \
'# for Isaac Sim' \
'unset CARB_APP_PATH' \
'unset EXP_PATH' \
Expand Down

0 comments on commit b1be6bb

Please sign in to comment.