如何从基础环境中安装的conda 4.3更新?

时间:2018-03-28 14:15:34

标签: anaconda conda miniconda

我已将conda更新(或安装)到高于4.3的版本,但出于测试目的,我安装了conda = 4.3。现在,我无法在激活base环境的情况下将conda更新回更高版本。

$ conda update conda

PackageNotInstalledError: Package is not installed in prefix.
  prefix: /home/user/miniconda3/envs/base
  package name: conda


usage: conda [-h] [-V] command ...
conda: error: argument command: invalid choice: '/home/user/miniconda3/bin/conda' (choose from 'info', 'help', 'list', 'search', 'create', 'install', 'update', 'upgrade', 'remove', 'uninstall', 'config', 'clean', 'package')

或者如果我尝试直接安装conda:

$ conda install conda=4.5
Fetching package metadata ...................

CondaEnvironmentNotFoundError: Could not find environment: /home/user/miniconda3/envs/base .
You can list all discoverable environments with `conda info --envs`.

usage: conda [-h] [-V] command ...
conda: error: argument command: invalid choice: '/home/user/miniconda3/bin/conda' (choose from 'info', 'help', 'list', 'search', 'create', 'install', 'update', 'upgrade', 'remove', 'uninstall', 'config', 'clean', 'package')

如何才能回到最新版本的conda?

1 个答案:

答案 0 :(得分:2)

此错误源于conda 4.3和4.4之间的更改,以将“主”环境从root重命名为base。请注意,当base环境实际上不在该目录中时,错误消息显示conda正在envs目录中查找名为base的环境。如果指定前缀,则可以解决此问题:

conda install conda=4.5 -p /home/user/miniconda3