Simplified MWE => Suppose I have Anaconda and do the following:
conda create -n demo python=3.6
conda activate demo
conda install seaborn
The last command installs 39 new packages including seaborn
, matplotlib
and pandas
. Now suppose that time passes and I continue to set up my environment and wish to explicitly install matplotlib
and pandas
:
conda install matplotlib pandas
This tells me "All requested packages already installed", which is okay. Now however, if I decide I don't need seaborn
anymore and remove it,
conda remove seaborn
this removes ALL 39 packages that were installed when seaborn
was installed, including both matplotlib
and pandas
, which I explicitly installed after that! How can I avoid this problem?
My expected behaviour would be that conda remove seaborn
removes seaborn
and all of its dependencies, but does not remove any package (or dependencies thereof) that was explicitly installed before or after seaborn
. Some might say just uninstall seaborn
and all 39 packages, and then manually reinstall matplotlib
and pandas
. This works in trivial cases, but once there are e.g. 25 packages with complex interdependencies, this becomes very complicated, and at the very least a complete nuisance to maintain.
As a concrete example of this, how can I construct a full Anaconda environment minus a particular package and only the packages that depend on it? I tried:
conda create -n test python=3.6 anaconda
conda remove libtiff # I want this to strictly only remove libtiff and its recursive dependents, but obviously this is not what happens
but the second line removes essentially every single package in the entire environment as it removes anaconda
. Any ideas?