Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conda hangs in "solving environment" when installing STSci packages

I run Ubuntu 18.04.1 LTS on a virtual machine on Windows 10. I've installed Anaconda 5.3 without any issues, but when I try to install an STSCI environment with the command line:

conda create -n astroconda stsci

the terminal gets stuck in "Solving Environment" (I have version 4.5.11 of conda). Yesterday I waited for about 4 hours before giving up. I would like to know if there is a known issue about this problem and if it can be related to the quantity of disk and RAM assigned to the virtual machine.

like image 218
Paolo Avatar asked Oct 09 '18 12:10

Paolo


People also ask

Why does conda take so long?

Unlike many package managers, Anaconda's repositories generally don't filter or remove old packages from the index. This allows old environments to be easily recreated. However, it does mean that the index metadata is always growing, and thus conda becomes slower as the number of packages increases.

How long does conda update conda take?

(Q) The feedstock for a package from conda-forge is updated, how long should it take to update on Anaconda Cloud? It depends on the queue, but a good rule of thumb is to wait at least 30 mins - 2 hours. If you don't see it after 24 hrs, please raise an issue.


1 Answers

I will write a more general solution, to Conda's "Solving Environment" issue, which I had the uttermost pleasure with.

Short answer of things to try:

  • As already mentioned try updating Conda with conda update conda or even better, the whole base environment conda update --all.
  • Specify package and build version using <package>=<version>=<build> e.g. sage=8.3=py27_3. Search available versions by conda search <package>.
  • Like for the package, you can also specify python version and ideally some other dependencies. Check dependencies with conda info <package>.
  • Check current configuration inside the .condarc file or with conda config --get and check if you maybe have additional restrictions, as normally you will only find the channels defined there.
  • When working with additional channels put conda-forge or the channel you want to use on top and add channel_priority: strict. So your .condarc file would look like this:
channel_priority: strict
channels:
  - conda-forge
  - defaults
  • Contrariwise to the above, remove the first line and try adding --no-channel-priority to the command. This one helped me a couple times since updating to Conda 4.6.

If above does not work:

When conda seem stuck it is possibly having too many options or some conflicts resulting in the SAT solver getting clause counts of multiple millions.

To check if this is the case add -vv or --debug and you will later see lines like Invoking SAT with clause count: XXX. If it stays at one of these lines for long time, then try specifying version for packages as above. If there seem another issue, try the conda GitHub.

Another useful tip if you are using the conda-forge channel, is to go over their Tips & tricks.

like image 141
Akimiya Avatar answered Sep 18 '22 12:09

Akimiya