darthbith
darthbith

Reputation: 19597

How to update from conda 4.3 installed in base environment?

I have updated (or installed) conda to a version which is higher than 4.3, but for testing purposes, I installed conda=4.3. Now, I cannot update conda back to a higher version with the base environment activated.

$ 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')

or if I try to install conda directly:

$ 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')

How can I get back to a more recent version of conda?

Upvotes: 2

Views: 5152

Answers (1)

darthbith
darthbith

Reputation: 19597

This error results from the change between conda 4.3 and 4.4 to rename the "main" environment from root to base. Note that the error message shows that conda is looking for an environment named base in the envs directory, when the base environment is not actually in that directory. If you specify a prefix, you can fix this problem:

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

Upvotes: 4

Related Questions