The environment is inconsistent, please check the package plan carefully

avatar
Borislav Hadzhiev

Last updated: Apr 10, 2024
4 min

banner

# The environment is inconsistent, please check the package plan carefully

The Anaconda error "The environment is inconsistent, please check the package plan carefully" occurs when you have inconsistent packages in your Conda environment.

Issue the conda install anaconda command to resolve the error.

Here is the complete stack trace.

shell
The environment is inconsistent, please check the package plan carefully The following packages are causing the inconsistency: - defaults/win-64::absl-py - defaults/win-64::alabaster== - defaults/win-64::anaconda-client== - defaults/win-32::anaconda== ... done

The first thing you should try is to run the conda install anaconda command.

shell
conda install anaconda

conda install anaconda

The command will likely prompt you to confirm after it finds the packages that need to be updated. Make sure to type y and press Enter.

The conda install anaconda command:

  1. Installs the anaconda package.
  2. Removes unnecessary packages.
  3. Updates outdated packages.

Note that it might take a couple of minutes for Anaconda to figure out which packages it has to install, remove and update.

If the issue persists, try to run the conda update --all command.

shell
conda update --all

conda update all

The command updates all packages in the environment so any version clashes should be resolved.

# Installing the packages from the error message

If the error persists, it is most likely caused by the packages listed in the error message.

Something that often helps to resolve the inconsistency is to run the conda install <package_name> command for each package from the error message.

shell
conda install requests

conda install package

Make sure to replace requests with one of the names of the packages from your error message.

Try to issue the command separately for each package.

For example, if your error message looks as follows.

shell
- defaults/win-64::absl-py - defaults/win-64::requests== - defaults/win-64::scipy==

You would issue the following commands.

shell
conda install absl-py conda install requests conda install scipy

If the issue persists, run the conda update --all command after installing the packages from the error message.

shell
conda update --all

conda update all

# Try to update your base environment

If the error persists, try to update the packages in your base environment.

  1. Activate the base environment.
shell
conda activate base
  1. Install the anaconda package to remove unnecessary packages and install missing/outdated packages.
shell
conda install anaconda
  1. Update all packages in the base environment.
shell
conda update --all

# Force update the environment

If the error persists, you could try to force update the virtual environment.

You can use the conda info --envs command to get the name of the active environment.

shell
conda info --envs

get name of active environment

The command shows an asterisk next to the path of the currently active environment.

The command is formatted as follows.

shell
conda update -n YOUR_ENV -c defaults conda --force

Make sure to replace the YOUR_ENV placeholder with the name of your environment.

For example, to force update the base environment, issue the following command.

shell
conda update -n base -c defaults conda --force

If the issue persists after running the command, try to issue the following 2 commands.

shell
conda install anaconda conda update --all

# Revert the environment to a previous version

If the error persists, you can also try to revert the environment to a previous version.

Issue the following command to list the history of each change to the current environment.

shell
conda list --revisions

list history of changes to environment

Notice that each change is associated with a revision number, e.g. (rev 11).

You can try to revert the environment to a working state.

You can install a specific revision number by issuing the following command.

shell
conda install --revision 11

Make sure to replace 11 with your revision number.

The command restores the environment to a previous revision.

# Install conda with the --force-reinstall flag

If the error persists, try to install conda with the --force-reinstall flag.

  1. Activate the base environment.
shell
conda activate base
  1. Reinstall the conda package with the --force-reinstall flag.
shell
conda install conda --force-reinstall conda install conda --force-reinstall

Note that it might be necessary to run the command multiple times.

  1. Update all packages in the environment.
shell
conda update --all

# Uninstalling and reinstalling the packages that caused the issue

If the error persists, try to uninstall and then reinstall the packages that caused the issue.

You can use the conda remove package_name command to uninstall the package.

For example, if your error message looks as follows.

shell
- defaults/win-64::absl-py - defaults/win-64::requests== - defaults/win-64::scipy==
Make sure to not uninstall packages that are required for Anaconda to function. For example, don't uninstall packages whose names start with anaconda-.
  1. You can uninstall the packages by issuing the following commands.
shell
conda remove absl-py conda remove requests conda remove scipy

You can also uninstall the packages using a single command.

shell
conda remove absl-py requests scipy
  1. Update all packages in the environment after uninstalling the offending packages.
shell
conda update --all
  1. Reinstall the packages that you previously uninstalled.
shell
conda install absl-py conda install requests conda install scipy

I've also written an article on how to install a specific version of an Anaconda package.

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.