马春杰杰 Exit Reader Mode

CondaUpgradeError: This environment has previously been operated on by a conda version that’s newer

今天装环境的时候conda提示:

Solving environment: failed

CondaUpgradeError: This environment has previously been operated on by a conda version that's newer
than the conda currently being used. A newer version of conda is required.
  target environment location: /home/ubuntu/anaconda3/envs/detect
  current conda version: 4.5.12
  minimum conda version: 4.12

Update conda and try again.
    $ conda install -p "/home/ubuntu/anaconda3" "conda>=4.12"

最新的anaconda安装包是2018年发布的,自带的conda版本是4.5.11,很明显版本有点低,所以我们需要手动升级,打开下面这个网站:https://anaconda.org/anaconda/conda/files?version=4.5.13

选择对应的系统下载好conda的包,比如:linux-64/conda-4.5.13-py37_0.tar.bz2这个,下载完毕之后,进入base环境中,输入:

conda install conda-4.5.13-py37_0.tar.bz2

(base) ubuntu@part2:~/bigdisk$ conda install conda-4.5.13-py37_0.tar.bz2 

Downloading and Extracting Packages
############################################################################################################## | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

这样就成功升级conda版本,不过这个时候仍会报错,最后运行一下:conda config --set allow_conda_downgrades true

之后就可以正常安装了。

相关问题:

本文最后更新于2022年6月25日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!