I'd like to use
mamba activate [env]
in a shell script.
What would be the equivalent of conda shell.bash hook
?
I've tried mamba shell.bash hook
and mamba shell hook -s posix
.
I'd like to use
mamba activate [env]
in a shell script.
What would be the equivalent of conda shell.bash hook
?
I've tried mamba shell.bash hook
and mamba shell hook -s posix
.
You can initialize mamba in your shell with the command mamba init
.
However, you may want to run the hook subcommand in a non-interactive bash script where you need to activate an environment. There's no equivalent of conda shell.bash hook
for mamba. To initialize mamba "on the fly", you must source the file $MAMBA_ROOT_PREFIX/etc/profile.d/mamba.sh
, for example: source ~/miniconda3/etc/profile.d/mamba.sh
.
You want to do this after initializing conda with eval "$(conda shell.bash hook)"
.
By specifying the full path to your mamba installation, the following works:
source ~/.lib/mamba/bin/activate [env]