Solution
The following should, in most cases fix such problems.
conda update conda -n base
conda update --all
conda version: 4.13
(check with: conda --version
)
Disclaimer: I maintain over 60 conda-forge packages. This snippet has mostly gotten me out of the error so far.
A recommended fail-safe
As a fail safe, please always prefer creating conda environments from environment-specification files: environment.yml
.
# update a global environment from a file
conda env update -f ./environment.yml --prune
If you don't already have an environment definition/scpecification file, you can create one as follows. (source)
## Export a platform independent copy of an environment
# - This will only include packages you installed explicitly.
conda env export --from-history > path/to/environment.yml
Tips
The conda solver may be slow and you don't have to endure such pain of helplessly waiting when the environment solver finishes and installs the packages.
An easier alternative is to use mamba
as a drop-in replacement of conda
. Here's how:
conda install -n base mamba -c conda-forge
mamba install -n some_env -c some_channel package1 "package2>=2.1.0"
To update with mamba
:
# Global env + Use file
mamba env update -f ./environment.yml --prune