Skip to content

[Bug Report] conda activate orbit using incorrect path for setup_python_env.sh #407

Closed

Description

@mattmazzola

If you are submitting a bug report, please fill in the following details and use the tag [bug].

Describe the bug

Another issue noticed when attempting to resolve installations issue described in #406

When attempting to activate orbit environment, it fails to find setup_python_env.sh because it is looking in the current, Orbit repo directory instead of the _isaac_sim symbolic linked directory where it should.

Steps to reproduce

Please try to provide a minimal example to reproduce the bug. Error messages and stack traces are also helpful.

conda activate orbit
/home/mattm/repos/orbit/_isaac_sim/setup_conda_env.sh:.:20: no such file or directory: /home/mattm/repos/orbit/setup_python_env.sh```

setup_conda_env.sh

#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
MY_DIR="$(realpath -s "$SCRIPT_DIR")"
# path=$SCRIPT_DIR
# while [[ $path != / ]];
# do
    
#     if ! find "$path" -maxdepth 1 -mindepth 1 -iname "_build" -exec false {} +
#     then
#         break
#     fi
#     # Note: if you want to ignore symlinks, use "$(realpath -s "$path"/..)"
#     path="$(readlink -f "$path"/..)"
    
# done
# build_path=$path/_build
export CARB_APP_PATH=$SCRIPT_DIR/kit
export EXP_PATH=$MY_DIR/apps
export ISAAC_PATH=$MY_DIR
. ${MY_DIR}/setup_python_env.sh

Work around?

Running conda activate orbit from the ISAACSIM_PATH allows the script to find the setup_python_env.sh file; however, I don't think this should be required

System Info

Describe the characteristic of your environment:

  • Commit: 0753e22
  • Isaac Sim Version: 2023.1.1-rc.8+2023.1.688.573e0291.tc
  • OS: Ubuntu 20.04.6
  • GPU: RTX 3080
  • CUDA: 12.2
  • GPU Driver: 535.171.04

Additional context

Add any other context about the problem here.

Checklist

  • I have checked that there is no similar issue in the repo (required)
  • I have checked that the issue is not in running Isaac Sim itself and is related to the repo

Activity

  1. mattmazzola commented on May 10, 2024

    @mattmazzola
    Author

    Upon further investigation I think the issue is with the use of BASH_SOURCE[0]
    I am using Zsh and this variable is not defined when running the script resulting in the wrong path being set for $MY_DIR thus the wrong path to find setup_python_env.sh

    I changed ${BASH_SOURCE[0]}" to $0 and added log statements to verify, and conda activate seems to work now!

    (orbit) ➜  orbit git:(main) ✗ conda deactivate    
    (base) ➜  orbit git:(main) ✗ conda activate orbit
    BASH_SOURCE_0: 
    0: /home/mattm/repos/orbit/_isaac_sim/setup_conda_env.sh
    

    It looks like BASH_SOURCE[0] is used in different places throughout the repo which may mean this problem would exist in many places.

    Solution

    I think setup_conda_env.sh comes from installation of Isaac sim so I am not sure where to send PR to fix, but this is what I arrived at so both Bash and Zsh (and hopefully others work)

    if [ -n "$BASH_VERSION" ]; then
        # Bash
        SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
    else
        # Fallback for other shells
        SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
    fi
  2. mattmazzola commented on May 10, 2024

    @mattmazzola
    Author

    The above comment only solved the issue about activating orbit environment.
    However, it did not fix the issue with modules.

    Here is more complete solution: #103 (comment)

  3. added a commit that references this issue on May 10, 2024
    ac20458
  4. added a commit that references this issue on Nov 21, 2024
    3705067
  5. added a commit that references this issue on Jul 1, 2026
    81a58bf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions