2

My Anaconda installation has been taking a long time to resolve dependencies when installing new packages and environments. I regularly do conda update conda in the base environment but that didn't solve the problem so I also tried to update Anaconda today by calling conda update anaconda and now it has been stuck on 'Solving environment' for over half an hour.

(base) Mac-mini:~ username$ conda list anaconda$
# packages in environment at /anaconda3:
#
# Name                    Version                   Build  Channel
anaconda                  2019.03                  py37_0  
(base) Mac-mini:~ username$ conda update anaconda
Collecting package metadata (repodata.json): done
Solving environment: \ 

What could be wrong and what shall I do? Hard to know since there is no actual error message, just the endless timer ticking away...

Other info

If it helps, here are two examples of the kind of problems I have had installing new packages. I see things like this:

Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                             

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package numpy conflicts for:
opty -> numpy[version='>=1.8.1']
opty -> cyipopt[version='>=0.1.7'] -> numpy[version='1.10.*|1.11.*|1.12.*|>=1.14.6,<2.0a0|>=1.16.5,<2.0a0|>=1.18.5,<2.0a0|>=1.19.2,<2.0a0|>=1.18.4,<2.0a0|>=1.18.1,<2.0a0|>=1.9.3,<2.0a0|>=1.9|>=1.11.3,<2.0a0|>=1.11|1.13.*|>=1.16.6,<2.0a0|>=1.15.1,<2.0a0']

and

Updating pandas is constricted by 

anaconda -> requires pandas==0.24.2=py37h0a44026_0

(This is what lead me to think anaconda itself is somehow creating dependency constraints).

Bill
  • 10,323
  • 10
  • 62
  • 85
  • Can you share the contents of the base environment? – AMC Nov 24 '20 at 23:11
  • 1
    At some point did you explicitly request a specific version of pandas? That could be locking things down. To check, one can view the explicit specifications by exporting an env with `conda env export --from-history`. For example, one could loosen the specification on `pandas` (assuming that's the issue), by running `conda install --update-specs pandas`. That shouldn't actually install anything but will make it so only `pandas` is in the explicit specs, instead of a version specification like `pandas=0.22`. – merv Nov 25 '20 at 14:50
  • @AMC [here](https://textuploader.com/1e734/raw) is the package list for this base environment. I tend to install a lot of packages in the base when creating a new environment because I usually forget the `conda activate` step. I usually then have to uninstall them but ... – Bill Nov 26 '20 at 00:48
  • 1
    @merv Thanks. I tried the `conda env export --from-history` and [here is the output of that](https://textuploader.com/1e73c/raw). Doesn't seem like there is a pandas version constraint. Can you see anything else that looks like a problem? – Bill Nov 26 '20 at 00:51
  • I also tried `conda install --update-specs pandas` but then it starts `Solving environment: | ` which is never-ending. – Bill Nov 26 '20 at 03:39
  • 1
    Thanks for following up. You're right - I don't see any problematic constraints. Instead, I suspect that the main issue with the slow solve is that most of your packages are currently from `defaults` channel, whereas judging from the YAML, `conda-forge` has subsequently become the prioritized channel. This can trigger Conda to try to reinstall everything from `conda-forge` when an `update` command is run and when you have all the Anaconda distribution packages in there, that means a ton of stuff to solve. Perhaps a `conda update --override-channels -c defaults anaconda` could speed it up. – merv Nov 26 '20 at 05:09
  • Thanks. That seems to have worked—it [downloaded 265 MB of packages](https://textuploader.com/1e7ii/raw). It seems to have added 38 new, removed about 11, updated about 198 and superseded about 23. I'm just running `conda update conda` but its still taking a while to solving environment. I'll leave it overnight and report in the morning... – Bill Nov 26 '20 at 06:06
  • After about 20 mins it solved the environment and seems to have downloaded a whole new set of packages. Looks like it updated/superceded most of them to versions from conda-forge which I think is what you were intending. As a test I then tried to uninstall one package. Unfortunately it is still taking a long time to solve the environment. Was the override channels command you suggested above a permanent fix or do I need to invoke it every time I do something? – Bill Nov 26 '20 at 06:40
  • _I tend to install a lot of packages in the base _ That is almost certainly a large part of the issue. Your best bet would be to clean up the base environment, and create a new environment for each project/application. – AMC Nov 26 '20 at 21:28
  • @AMC Cleaning up the base environment is exactly what I want to do. But how? Using [`conda install --rev 1`](https://stackoverflow.com/questions/41914139/how-to-reset-anaconda-root-environment) ([not recommended](https://stackoverflow.com/a/52841447/1609514)) apparently). I have not found a good answer to this yet. Please advise! My goal is a minimalist base environment (Note: I have 13 specific environments for projects that are well maintained and I'd rather not have to recreate them all). – Bill Nov 26 '20 at 23:09
  • Hmm, I wasn't aware that `conda install --rev` could lead to issues. How complex are the environments you have? Do they all mostly contain Conda and pip packages? – AMC Nov 28 '20 at 02:35
  • 1
    My envs are not that complex. I was hoping to avoid it but [uninstalling Anaconda](https://docs.anaconda.com/anaconda/install/uninstall/) and then reinstalling and rebuilding all the env's from scratch seems like the only solution. I'll consider it a 'spring cleaning' exercise. If only there was something like `conda remove --name base --all` for the base env. Thanks very much (and @merv) for your help. – Bill Nov 28 '20 at 19:44

0 Answers0