243

I tried to update or install new packages from anaconda and lately, this message has appeared:

The environment is inconsistent, please check the package plan carefully
The following package are causing the inconsistency:

   - defaults/win-32::anaconda==5.3.1=py37_0

done

I tried with conda clean --all and then conda update --all but it persists.

Conda Info

active environment : base
    active env location : C:\Users\NAME\Continuum
            shell level : 1
       user config file : C:\Users\NAME\.condarc
 populated config files : C:\Users\NAME\.condarc
          conda version : 4.6.11
    conda-build version : 3.17.7
         python version : 3.7.3.final.0
       base environment : C:\Users\NAME\Continuum  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/win-32
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/free/win-32
                          https://repo.anaconda.com/pkgs/free/noarch
                          https://repo.anaconda.com/pkgs/r/win-32
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-32
                          https://repo.anaconda.com/pkgs/msys2/noarch
          package cache : C:\Users\NAME\Continuum\pkgs
                          C:\Users\NAME\.conda\pkgs
                          C:\Users\NAME\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\NAME\Continuum\envs
                          C:\Users\NAME\.conda\envs
                          C:\Users\NAME\AppData\Local\conda\conda\envs
               platform : win-32
             user-agent : conda/4.6.11 requests/2.21.0 CPython/3.7.3 Windows/10 Windows/10.0.17763
          administrator : False
             netrc file : None
           offline mode : False
gerrit
  • 24,025
  • 17
  • 97
  • 170
Angel Salazar
  • 2,564
  • 2
  • 10
  • 16
  • 2
    did anyone get any progress on this, if I have to manually update 100 issues it will take me forever. i cant even uninstall anaconda and start over, due to the same issue :( – Tantable Dec 30 '21 at 15:37
  • for those who decide to uninstall-reinstall: https://docs.anaconda.com/anaconda/install/uninstall/ https://docs.conda.io/projects/conda/en/latest/user-guide/install/macos.html#install-macos-silent I was in the situation that every command involving ```conda``` failed due to environment inconsistency. Highly recommend to uninstall-reinstall anaconda entirely – siegfried Dec 18 '22 at 01:00

21 Answers21

146

I had faced the same problem. Simply running

conda install anaconda

solved the problem for me.

mm49307
  • 2,490
  • 2
  • 19
  • 15
  • 2
    I have the same problem, and I did as you suggested. But I'm still getting inconsistencies. I'm running osx-64, do you run osx also? – pink.slash Apr 23 '19 at 23:51
  • Yes, I have macOS Mojave v10.14.4. – mm49307 Apr 27 '19 at 06:28
  • 7
    I get the error with `conda update --all`, so it doesn't solve the problem (on some cases), but `conda install` seems to work (and to update other packages in the list) – Giacomo Catenazzi Jun 20 '19 at 07:31
  • 25
    For me the solution was in 2 steps: first, `conda install anaconda` which just installed anaconda package and removed one conda package + updated a few dependencies. Then I followed it with `conda update --all` and everything was fine again! My system is Ubuntu 18.04 and I ran into this problem after updating `spyder` package which also caused an update to `conda` itself, and this caused the inconsistency. – MF.OX Jul 03 '19 at 14:28
  • 7
    `conda install anaconda` worked for me too, although I had to wait more than 5 minutes for conda to propose a package plan. – Sahar Jul 29 '19 at 19:51
  • When I did `conda install anaconda` it decided to upgrade 153 packages, install an additional 151 and downgrade 2. 5 mins later and it's still going. I'm in my base environment. – Bill Aug 13 '19 at 16:43
  • 20 minutes later and the spinning `/ - | \\` is still going >:( – Jason S Oct 20 '20 at 23:39
  • @JasonS did it ever complete? I am in the same situation currently – 404error Feb 04 '21 at 09:38
  • I gave up, restarted with Miniconda3-4.7.12+mamba. (requires Python 3 at least for base environment; this is the last miniconda installer with BSD3 licensing) – Jason S Feb 04 '21 at 15:01
  • 6
    Try `conda update conda` first before `conda update anaconda`. The former might solve your problems with minimal needs for installs/upgrades/downgrades and just updates the [ana,mini]conda system and its dependency needs itself, rather than the entirety of anaconda3. Also, running the former first, may make the latter work more efficiently if you decide to do that as well. – slowkoni Mar 14 '21 at 21:31
  • 1
    why or how does installing `conda install anaconda` fix the issue? does installing `anaconda` trigger some fix all inconsistencies? or does it trigger an `conda update --all`? – Trevor Boyd Smith Mar 31 '21 at 13:44
  • conda update conda was sufficient to resolve conflicts in my case – 218 Jan 31 '22 at 08:42
  • In my case, I had to run `conda install anaconda` *two* times in a row. The first one took several long minutes, and conda downgraded and removed a number of packages, but I still got the warnings. So I ran `conda install anaconda` a second time. This time it upgraded anaconda itself and a number of other packages. I finished with `conda update --all`, and now my environment is consistent. – ali14 Mar 12 '22 at 17:01
  • 2
    For those using `miniconda` if you don't want to install `anaconda` see @Jack Kelly' answer. (activate the environment causing problem, then `conda install conda --force-reinstall` twice (yes twice), then `conda update --all`), and don't forget to add +1 to @Jack Kelly' answer if it helped ;-). – Rivers May 10 '22 at 15:39
  • Doing ```conda update -all``` a bunch of times mixed with ```conda install [any of the offending packages]``` did the trick for me. – hrrrrrr5602 May 11 '22 at 00:47
78

saw this on Google Groups

This message was added in conda 4.6.9, previously there was no indication when conda detected an inconsistent environment unless conda was run in debug mode. It is likely that your environment was inconsistent for some time but the upgrade to conda made it visible. The best option it to run "conda install package_name" for the inconsistent packages to let conda try to restore consistency.

and it really works for me.

Maybe you should try conda install anaconda in your situation.

tys1998
  • 875
  • 5
  • 8
  • 12
    The inconsistent environment was a nagging issue for ALL of my conda environments, `conda install anaconda` didn't cut it. I need to do exactly this: (re)install each package it called out individually. Thanks! – conner.xyz May 02 '19 at 20:38
  • 1
    @conner.xyz I found myself in a similar situation, and decided that writing a snippet that reinstalled each package was a fair way to go (see my answer below). Was lucky enough to not have to work through multiple environments, however. – YenForYang May 22 '19 at 03:31
  • 2
    Great answer - really nice to have an explanation of why this has happened as well as a succinct fix that (at least for me) works perfectly. – DrAl Aug 07 '19 at 09:48
53

The inconsistencies are caused due to different versions of the packages, and their clashing dependencies.

conda update --all

This command updates all the packages, and then conda solves the inconsistency on its own.

Sachin Kumar
  • 887
  • 1
  • 7
  • 17
  • 1
    This is the better answer, because it only updates packages that conflict and caused the inconsistencies. – Rich Lysakowski PhD Jul 28 '19 at 22:16
  • 7
    This does NOT solve the problem because the inconsistency is not caused by dependencies, but rather by [change in metadata](https://github.com/conda/conda/issues/8490#issuecomment-481849564) on the server side (i.e. in channel). I tried this and it didn't work, however as the link says, it's a warning that can be ignored. – jena Sep 04 '19 at 13:22
  • 1
    While "conda upgrade conda" fails, "conda install anaconda; conda update --all" solved my problem. – Joonho Park Jan 13 '22 at 03:28
  • ```conda update --all``` just tells me about the package conflicts without attempting to solve them. – Elliott Collins Apr 16 '22 at 22:27
28

Had this same problem and none of the other solutions worked for me. Ended up having to uninstall and reinstall conda, then reinstall all of my libraries.

jschabs
  • 562
  • 4
  • 20
  • 11
    Why the downvote? I tried many of the other solutions, which all resulted in the same message about inconsistent packages and conda spinning forever. A full reinstall took just a few minutes and gave me a working system again. I obviously wouldn't recommend this if you have any valuable environments that need to be preserved. – Bas Swinckels Aug 24 '19 at 14:32
  • 2
    @BasSwinckels lol maybe I didn't emphasize enough that NONE of the other solutions worked for me. – jschabs Aug 28 '19 at 19:22
  • 1
    This is the only thing that works for me... I'm already on my third installation of anaconda... I'm never going to update it again. – An old man in the sea. Dec 28 '21 at 19:44
21

Ultimate solutions:

conda activate base
conda install anaconda
conda update --all

Works on Windows 10 and Ubuntu 18.04 (credits to @MF.OX for ubuntu).

Removed following problems for me:

  • The environment is inconsistent
  • WARNING conda.base.context:use_only_tar_bz2(632)
hans
  • 1,043
  • 12
  • 33
  • 1
    thanks, it works. After base env update, I have activated my virtual env, and repeated ```conda upadte --all``` to get ```# All requested packages alread installed.``` message. – Hongsoog Jul 02 '20 at 06:14
21

I was getting an environment is inconsistent error when I tried to update my base conda environment. I'm using miniconda. Unfortunately, none of the answers above worked for me.

What did work for me was:

conda activate base
conda install conda --force-reinstall
conda install conda --force-reinstall
conda update --all

(Yes, for some reason it was necessary to run conda install conda --force-reinstall twice!)

Jack Kelly
  • 2,214
  • 2
  • 22
  • 32
  • 1
    I had `miniconda` and didn't want to install `anaconda` (as in the accepted answer) and this worked perfectly. And yes it was necessary to run `conda install conda --force-reinstall` twice! Just in case: change the name of your environment appropriately (`conda activate [environemtn_name]`). Thanks @Jack Kelly. – Rivers May 10 '22 at 15:33
  • I've installed Anaconda on my Mac. I needed pandoc. Could not find it in Anaconda navigator, so I tried conda. Got the same error as the OP. Tried this solution, and it fixed the error. I was able to install pandoc afterwards. – jmgonet May 15 '22 at 08:12
  • still having inconsistency in force-reinstall. how long have you waited for that? – siegfried Dec 16 '22 at 06:28
  • I was stuck in a loop whereby if I tried to remove the packages listed as the cause of the inconsistency I couldn't because of the inconsistency! `defaults/osx-64::conda==23.3.1=py38hecd8cb5_0` `conda-forge/osx-64::conda-build==3.21.8=py38h50d1736_0` `defaults/osx-64::anaconda-navigator==2.1.4=py38hecd8cb5_0` `defaults/osx-64::thinc==8.0.15=py38hc29d2bd_0` `defaults/noarch::conda-token==0.4.0=pyhd3eb1b0_0` For these packages, the solution presented here worked. – doine May 19 '23 at 15:45
  • When I entered the 4th day of running the first force-reinstall and was still at 25%, I gave up and reinstalled Anaconda from scratch. Not only I had to resume working, but also Windows required a restart for updates. – Ronan Paixão Jul 17 '23 at 11:57
14

If the other solutions don't work, reverting the environment can fix this.

Use conda list --revisions, pick a revision number, and use conda install --revision [#] going back step-by-step until everything works again.

Max Vollmer
  • 8,412
  • 9
  • 28
  • 43
kenl
  • 195
  • 1
  • 7
12

Given a situation like the following,

> conda update -c intel --all
Collecting package metadata: done
Solving environment: |
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:

  - intel/win-64::ipython==6.3.1=py36_3
  - intel/win-64::prompt_toolkit==1.0.15=py36_2
done

As mentioned in other answers, the idea is to have some sort of re-installation to occur for the inconsistent packages.

Thus, with a few copy-&-paste's, you could:

> conda install intel/win-64::ipython==6.3.1=py36_3
Collecting package metadata: done
Solving environment: /
The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:

  - intel/win-64::ipython==6.3.1=py36_3
  - intel/win-64::prompt_toolkit==1.0.15=py36_2
done

## Package Plan ##

  environment location: c:\conda

  added / updated specs:
    - ipython


The following NEW packages will be INSTALLED:

  jedi               intel/win-64::jedi-0.12.0-py36_2
  parso              intel/win-64::parso-0.2.0-py36_2
  pygments           intel/win-64::pygments-2.2.0-py36_5
  wcwidth            intel/win-64::wcwidth-0.1.7-py36_6


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

(and you would have to repeat for all the packages)


My “Shortcut”

Alternatively, cook up an (ugly) one-liner (this should work for Windows as well as other platforms)

Note: by "ORIGINAL_COMMAND", I'm referring to any command that gives you the error message (without any other side-effects, ideally)

<ORIGINAL_COMMAND> 2>&1 | python -c "import sys,re,conda.cli; conda.cli.main('conda','install','-y',*re.findall(r'^\s*-\s*(\S+)$',sys.stdin.read(),re.MULTILINE))"

Expanding the above one-liner:

from re import findall, MULTILINE
from sys import stdin
from conda.cli import main

main(
    "conda", "install", "-y",
    "--force",  # Maybe add a '--force'/'--force-reinstall' (I didn't add it for the one-liner above)
    *findall(r"^\s*-\s*(\S+)$", stdin.read(), MULTILINE)  # Here are the offenders
)
YenForYang
  • 2,998
  • 25
  • 22
8

The command conda install -c anaconda anaconda did the trick for me. For my setup, I need to specify the channel otherwise it would not work. After running the command in the terminal, I was prompted to update a list of packages that was found to be inconsistent. Without this step, I was not able to install or update any packages with conda install <package_name> or conda update <package_name respectively.

Kris Stern
  • 1,192
  • 1
  • 15
  • 23
7

What worked for me was to

`conda remove <offending_packagename>`, 
`conda update --all` 

and then finally

`conda install <offending_packagename>`.
Yogendra
  • 1,208
  • 5
  • 18
  • 38
Milind R
  • 676
  • 1
  • 8
  • 20
6

To those of us who have miniconda and can't/don't want to install anaconda: the accepted answer works when adapted.

  1. conda install conda
  2. conda update --all

Would have commented, but my rep is too low.

harabat
  • 127
  • 2
  • 5
5

I had this problem for ages. The conda install anaconda might work, but it takes just way too long -- more than 24 hours on my machine.

Here is a solution that worked for me in under 5 minutes:

  1. Remove all the unneeded packages -- being careful to leave the ones that are essential for conda to operate.
  2. Then, use conda install anaconda.

But how?? there is a lot of them!

This is what I have done:

  1. Make a fresh envinroment with python, fairly bare-bone. then, list the packages in there:

conda create -n fresh python

conda activate fresh

conda list

Save the output, you will need it. 1b. go back to the base envinroment:

conda deactivate

  1. use the following snippet to generate a conda command that will remove all the inconsistent packages:

(good packages are)

exclusion_text = '''
_libgcc_mutex             0.1                        main  
_openmp_mutex             4.5                       1_gnu  
anyio                     2.2.0            py39h06a4308_1  
argon2-cffi               20.1.0           py39h27cfd23_1  
async_generator           1.10               pyhd3eb1b0_0  
...

... and more! get this from a good environment.

Note the usage of triple quotes (''') to use a multiline-string in python.

bad_packages_text = '''
  - https://repo.continuum.io/pkgs/main/linux-64/networkx-2.1-py36_0.tar.bz2/linux-64::networkx==2.1=py36_0
  - https://repo.continuum.io/pkgs/main/linux-64/spyder-3.2.6-> py36_0.tar.bz2/linux-64::spyder==3.2.6=py36_0
py36h4c697fb_0.tar.bz2/linux-64::jdcal==1.3=py36h4c697fb_0
 - defaults/noarch::jupyterlab_server==1.1.4=py_0
 - defaults/linux-64::argh==0.26.2=py37_0
... 

... and more! get this by copy-pasting the "The following packages are causing the inconsistency." message.

then, in python, process this:

exclusions = [line.split(' ')[0] for line in exclusion_text_lines if line !='']
bad_packages_lines = bad_packages_text.split('\n')
bad_packages = [line.split('::')[1].split('==')[0] for line in bad_packages_lines if line!='']
exclusions.append('conda') # make sure!
exclusions.append('tqdm')

finally, construct the life-saving command:

command_line = 'conda remove '
for bad_package in bad_packages:
    if bad_package not in exclusions:
        command_line = f'{command_line} {bad_package}'
command_line   

Since in solving the environment, all the packages on the remove list can be ignored, conda no longer needs to consider their versions, and the process is fast.

Possibly someone can refactor this method to make it easier -- or better yet, upgrade conda to enable quick reset base command.

This worked for me -- it took me longer to write this post than to execute these actions.

Good luck!

George Rey
  • 450
  • 3
  • 7
3

To solve this message I had to run conda update --all in my base environment three times after each other. Every time the number of inconsistent packages decreased until conda said:

# All requested packages already installed.

I'm on macOS Big Sur 11.6 using conda version 4.10.3.

Saaru Lindestøkke
  • 2,067
  • 1
  • 25
  • 51
  • This worked for me and I'm on macOS BigSur 11.6 as well, I guess it's related to this operating system. Thanks! – gioarma Jul 26 '22 at 08:32
3

In my case, none of the above worked. But this did the trick in less than a minute:

1- I downloaded again the lastest installer (miniconda in my case)

2- Run the installer with the -u option:

bash Miniconda3-py39_xxxx-Linux-x86_64.sh -u

3- Answer yes to all questions and let the installer finish

4- Then I could run conda update conda -all

Hope this helps...

ThiGre
  • 31
  • 1
2
conda install anaconda
conda clean --all
conda update --all

fix the problem for me

Yogendra
  • 1,208
  • 5
  • 18
  • 38
aigle81
  • 21
  • 3
2

This happened to me on my MacOS Ventura when I had to uninstall the osx-64 version and install the intel version (no comments from the peanut gallery, please). I got this when trying to "conda update conda":

The environment is inconsistent, please check the package plan carefully
The following packages are causing the inconsistency:

  - defaults/osx-64::holoviews==1.15.0=py39hecd8cb5_0
  - defaults/noarch::babel==2.9.1=pyhd3eb1b0_0
  - defaults/osx-64::anaconda-project==0.11.1=py39hecd8cb5_0
  - defaults/osx-64::jupyterlab==3.4.4=py39hecd8cb5_0
  - defaults/osx-64::datashader==0.14.1=py39hecd8cb5_0
  - defaults/osx-64::anaconda==2022.10=py39_0
  - defaults/osx-64::hvplot==0.8.0=py39hecd8cb5_0
  - defaults/osx-64::bkcharts==0.2=py39hecd8cb5_1
  - defaults/osx-64::conda-build==3.22.0=py39hecd8cb5_0
  - defaults/osx-64::anaconda-navigator==2.4.0=py39hecd8cb5_0
  - defaults/osx-64::sphinx==5.0.2=py39hecd8cb5_0
  - defaults/osx-64::_ipyw_jlab_nb_ext_conf==0.1.0=py39hecd8cb5_1
  - defaults/osx-64::statsmodels==0.13.2=py39hca72f7f_0
  - defaults/osx-64::dask==2022.7.0=py39hecd8cb5_0
  - defaults/osx-64::anaconda-client==1.11.0=py39hecd8cb5_0
  - defaults/noarch::jupyterlab_server==2.10.3=pyhd3eb1b0_1
  - defaults/osx-64::numpydoc==1.4.0=py39hecd8cb5_0
  - defaults/noarch::intake==0.6.5=pyhd3eb1b0_0
  - defaults/osx-64::pandas==1.4.4=py39he9d5cce_0
  - defaults/osx-64::jupyter==1.0.0=py39hecd8cb5_8
  - defaults/osx-64::conda-repo-cli==1.0.20=py39hecd8cb5_0
  - defaults/noarch::seaborn==0.11.2=pyhd3eb1b0_0
  - defaults/osx-64::spyder==5.3.3=py39hecd8cb5_0
  - defaults/noarch::xarray==0.20.1=pyhd3eb1b0_1

I edited the output into this command and ran it:

conda uninstall holoviews babel anaconda-project jupyterlab datashader anaconda hvplot bkcharts conda-build anaconda-navigator sphinx _ipyw_jlab_nb_ext_conf statsmodels dask anaconda-client jupyterlab_server numpydoc intake pandas jupyter conda-repo-cli seaborn spyder xarray

I then re-edited the command to this and ran it:

conda install holoviews babel anaconda-project jupyterlab datashader anaconda hvplot bkcharts conda-build anaconda-navigator sphinx _ipyw_jlab_nb_ext_conf statsmodels dask anaconda-client jupyterlab_server numpydoc intake pandas jupyter conda-repo-cli seaborn spyder xarray

I did one final

conda update conda

and things appear to be well. (Note: make sure you answer "y" to any "Proceed ([y]/n)?" prompts.

Winston Lee
  • 97
  • 1
  • 1
  • 10
1

You probably installed anaconda with python 2.7 but later you used python 3.x. Thus, you are getting an error message. In my case, I solved the problem by activating anaconda with python 2.7:

conda create --name py2 python=2.7
Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54
Jakir
  • 11
  • 1
1

Works with Miniconda + Windows x64 + Python 3.10:

conda activate base
conda update conda
conda update --all

Tested, works perfectly.

Note: Updating base is sufficient to fix issues with all other environments visible with conda env list.

Contango
  • 76,540
  • 58
  • 260
  • 305
0

In my environment.

1.

conda install anaconda
conda update --all

Then it works correctly.

0

My local environment is ubuntu 22.04 Tried to run: conda update anconda it did not work. what worked is removing the inconsistent package. Below is the command to be run on terminal;

conda remove [inconsistent package name]
conda update --all
-1

Try to have a look to the environment management https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

By using something along the lines

conda create --name astra python=3.5
conda activate astra
conda install -c astra-toolbox astra-toolbox

You can see that you can even specify target python version. Now play with the new packages installed. When unsatisfied, you can always do

conda deactivate
conda env remove -n astra

If you install everything to the base env and something gets broken, then probably better is not to install conda at all and go with default python managing it through pip.

VojtaK
  • 483
  • 4
  • 13