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

本文描述了解决在Linux中使用mamba时遇到的CondaValueError问题,涉及更改~/.condarc文件、设置默认求解器为libmamba,并更新~/.bashrc以优先使用mamba的过程。
摘要由CSDN通过智能技术生成

最近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超好用!

an an iterative solver is a method that solves a problem by repeatedly refining an initial guess until a desired accuracy is achieved. It is typically used for models with large and complex systems of equations, where it is difficult or time-consuming to solve the problem directly. On the other hand, a direct solver directly computes the exact solution to a problem by solving the equations in a single step. It is typically used for models with smaller and less complex systems of equations, where the computational cost of solving the problem directly is reasonable. In the case of this model, an iterative solver was chosen. This decision was likely made based on the nature and complexity of the equations involved. Iterative solvers are known for their ability to handle large and complex systems of equations more efficiently than direct solvers. They can provide approximate solutions with acceptable accuracy, even for problems where a direct solution is possible. However, it is important to note that using a direct solver could potentially result in a more accurate solution, as it computes the exact solution to the problem. If computational resources and time were not constraints, a direct solver may have been a preferred choice. Nevertheless, the iterative solver was deemed sufficient and satisfactory for the purposes of this model, considering the constraints and trade-offs involved. Overall, the choice between an iterative solver and a direct solver depends on the specific characteristics of the model and the desired level of accuracy within the given computational resources and time constraints.
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值