What does conda do when "solving environment"

PythonAnacondaUpdatesCondaPackage Managers

Python Problem Overview


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?

Python Solutions


Solution 1 - Python

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.

Solution 2 - Python

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.

Solution 3 - Python

JUST WAIT! I wasted hours trying to fix this. It turns out, it just took around 45 minutes :/

Solution 4 - Python

conda install --prune <<package>> helped me to install the right channel.

Suspecting environment used are for zipline and channel used not compatible with existing one. prune takes a lot of time but helped me in solving the environment issues.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestiondkvView Question on Stackoverflow
Solution 1 - Pythonzhaofeng-shu33View Answer on Stackoverflow
Solution 2 - PythonKatyjean57View Answer on Stackoverflow
Solution 3 - PythonStuart RuckerView Answer on Stackoverflow
Solution 4 - PythonVenkat GovindanView Answer on Stackoverflow