最近mamba受欢迎,可以加速环境的配置,在已有的conda基础上安装mamba可能会导致
CondaValueError: You have chosen a non-default solver backend (conda) but it was not recognized. Choose one of: classic
或者
CondaValueError: You have chosen a non-default solver backend (libmamba) but it was not recognized.
等问题的出现。导致conda也运行不了,mamba也运行不了,我尝试了很多方法,包括重新安装conda,都没有作用
我出现这样的问题是通过以下方法解决,在Linux下
vi ~/.condarc
将内容改成如下:
auto_activate_base: true
channels:
- conda-forge
- defaults
show_channel_urls: true
然后就是安装mamba,要安装并设置新的求解器,现在mamba好像只能安装到base下
conda install -n base conda-libmamba-solver
conda config --set solver libmamba
安装mamba
conda install mamba -n base -c conda-forge
如果还有问题可以去vi ~/.bashrc
将conda初始化改一下,添加mamba
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/anaconda3/etc/profile.d/conda.sh" ]; then
. "/home/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/home/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
if [ -f "/home/anaconda3/etc/profile.d/mamba.sh" ]; then
. "/home/anaconda3/etc/profile.d/mamba.sh"
fi
# <<< conda initialize <<<
当然,具体的conda路径需要修改一下
此时cat ~/.condarc 可以看到
auto_activate_base: false
solver: libmamba
channels:
- conda-forge
- defaults
show_channel_urls: true
mamba超好用!