Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does conda do when "solving environment"

Whenever I run conda install/remove/update <package>, it tells me it's "Solving environment" for some time before telling me the list of things it's going to download/install/update. Presumably it's looking for dependencies for <package>, but why does it sometimes remove packages after doing this operation? For example, as I was trying to install Mayavi, it decided it needed to remove Anaconda Navigator.

Furthermore it does not provide an option to perform only a subset of the suggested operations. Is there a way to specify that I don't want a package removed?

like image 209
dkv Avatar asked Aug 08 '18 19:08

dkv


People also ask

What does conda environment do?

A conda environment is a directory that contains a specific collection of conda packages that you have installed. For example, you may have one environment with NumPy 1.7 and its dependencies, and another environment with NumPy 1.6 for legacy testing.

How long does it take conda to solve environment?

Conda takes 20+ minutes to solve environment when package is already installed.

How does the conda activate the environment?

To activate your Conda environment, type source activate <yourenvironmentname> . Note that conda activate will not work on Discovery with this version. To install a specific package, type conda install -n <yourenvironmentname> [package] . To deactivate the current, active Conda environment, type conda deactivate .

Does conda manage environments?

Conda centrally manages the environments you create, so, you don't have to bother about creating a folder for specific environments yourself. You can either start by creating an empty environment or mention the python version and packages you need at the time of creation itself.


2 Answers

You can add --debug option to the conda command and see the output from console(or terminal). For example, type conda update --debug numpy. From the output, we can see that the client requests repodata.json from channel list and do some computation locally in the Solving Environment Step.

like image 105
zhaofeng-shu33 Avatar answered Sep 20 '22 07:09

zhaofeng-shu33


As a side note on the "Solving Environment" step...
Lack of administrator privileges may affect whether or where you can install python packages.

I observed that my installs would hang on the "Solving Environment" step and never get through when attempting to install packages while logged in as a non-administrator.

Getting switched to admin was possible for me on the machine I was stuck on, so I just did that and it solved the problem.

Commenter explains workaround when this is not possible.

like image 32
Katyjean57 Avatar answered Sep 19 '22 07:09

Katyjean57