当前位置:   article > 正文

CondaValueError: You have chosen a non-default solver backend (conda) but it was not recognized.

condavalueerror: you have chosen a non-default solver backend (libmamba) but

最近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 

将内容改成如下:

  1. auto_activate_base: true
  2. channels:
  3. - conda-forge
  4. - defaults
  5. show_channel_urls: true

然后就是安装mamba,要安装并设置新的求解器,现在mamba好像只能安装到base下

  1. conda install -n base conda-libmamba-solver
  2. conda config --set solver libmamba

安装mamba

conda install mamba -n base -c conda-forge

如果还有问题可以去vi ~/.bashrc

将conda初始化改一下,添加mamba

  1. # >>> conda initialize >>>
  2. # !! Contents within this block are managed by 'conda init' !!
  3. __conda_setup="$('/home/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
  4. if [ $? -eq 0 ]; then
  5. eval "$__conda_setup"
  6. else
  7. if [ -f "/home/anaconda3/etc/profile.d/conda.sh" ]; then
  8. . "/home/anaconda3/etc/profile.d/conda.sh"
  9. else
  10. export PATH="/home/anaconda3/bin:$PATH"
  11. fi
  12. fi
  13. unset __conda_setup
  14. if [ -f "/home/anaconda3/etc/profile.d/mamba.sh" ]; then
  15. . "/home/anaconda3/etc/profile.d/mamba.sh"
  16. fi
  17. # <<< conda initialize <<<

当然,具体的conda路径需要修改一下

此时cat ~/.condarc 可以看到

  1. auto_activate_base: false
  2. solver: libmamba
  3. channels:
  4. - conda-forge
  5. - defaults
  6. show_channel_urls: true

mamba超好用!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/484201
推荐阅读
相关标签
  

闽ICP备14008679号