python – How to get base conda installation directory (not CONDA_PREFIX)?

I’m trying to figure out the best way to get the base conda installation directory.

I wrote this but I know this isn’t the best way to do it:

(base) -bash-4.2$ which conda

(base) -bash-4.2$ which conda | python -c "import sys; print("".join("")[:-2]))"

Is there some environment variable I’m missing?

Read more here: Source link