After updating conda
to version 4.4.x, the fish shell wrapper intended to define a conda
function that knows the path of
the conda
executable and calls it regardless of whether the Anaconda/Miniconda installation is in $PATH
. For me, this fails with
⋊> ~ conda activate base
fish: Unknown command 'shell.fish'
- (line 1):
begin; shell.fish activate base
^
from sourcing file -
called on line 60 of file /usr/local/Cellar/fish/2.7.1/share/fish/functions/eval.fish
in function 'eval'
called on line 67 of file /usr/local/share/anaconda/etc/fish/conf.d/conda.fish
in command substitution
called on line 65 of file /usr/local/share/anaconda/etc/fish/conf.d/conda.fish
in function 'conda'
called on standard input
with parameter list 'activate base'
Insert -g
before the path variables for the conda
executable and its root directory are defined
set -g _CONDA_EXE "[/your/path/to/anaconda]/bin/conda"
set -g _CONDA_ROOT "[/your/path/to/anaconda]"
The standard conda
installation installs its fish wrapper as follows (from /conda/utils/functions.sh
):
mkdir -p "$prefix/etc/fish/conf.d/"
rm -f "$prefix/etc/fish/conf.d/conda.fish"
echo "set _CONDA_EXE \"$conda_exe\"" > "$prefix/etc/fish/conf.d/conda.fish"
echo "set _CONDA_ROOT \"$prefix\"" >> "$prefix/etc/fish/conf.d/conda.fish"
cat "$src_dir/conda/shell/etc/fish/conf.d/conda.fish" >> "$prefix/etc/fish/conf.d/conda.fish"