1

I am trying to locate which conda executable I am using. For this, I want to use which command. As per man pages, it should return the path of the executable. Instead it returns some bash function

(base) ➜  ~ which conda
conda () {
    \local cmd="${1-__missing__}"
    case "$cmd" in
        (activate | deactivate) __conda_activate "$@" ;;
        (install | update | upgrade | remove | uninstall) __conda_exe "$@" || \return
            __conda_reactivate ;;
        (*) __conda_exe "$@" ;;
    esac
}

If I try to see the location of __conda_exe, again I get another function:

__conda_exe () {
    (
        __add_sys_prefix_to_path
        "$CONDA_EXE" $_CE_M $_CE_CONDA "$@"
    )
}

where is the conda function I am using?

A.B
  • 31,762
  • 2
  • 62
  • 101
asdf
  • 111
  • 4
  • 2
    Related: [Why not use "which"? What to use then?](https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then) – steeldriver Jul 01 '22 at 08:07
  • 2
    You've tagged your question `bash` - are you actually using `zsh` however? – steeldriver Jul 01 '22 at 08:08
  • 1
    If using `zsh` try typing `which -p conda` to see the path instead of the script. Starting version 4.4, conda uses a wrapper shell function to capture commands and pass it to the executable. If you want to know the version, you should use `conda --version` – Michael Harvey Jul 01 '22 at 11:52
  • yes, sorry I am using zsh! – asdf Jul 01 '22 at 13:41
  • In `zsh` `type __conda_exe` (same as `whence -v`, while `which` is `whence -c`, `c` for `csh` as `which` is initially a csh script for csh users) will tell you where the function definition was read from. – Stéphane Chazelas Jul 02 '22 at 08:47

1 Answers1

1

Since you’re using , I would recommend using the following:

whence -aSv conda

This will show you all the possible ways in which conda can be resolved.

Marlon Richert
  • 3,715
  • 5
  • 30