我已将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?
答案 0 :(得分:2)
此错误源于conda 4.3和4.4之间的更改,以将“主”环境从root
重命名为base
。请注意,当base
环境实际上不在该目录中时,错误消息显示conda正在envs
目录中查找名为base
的环境。如果指定前缀,则可以解决此问题:
conda install conda=4.5 -p /home/user/miniconda3