Does the `conda uninstall` and `pip uninstall` also removing dependencies but only ones that are not used by other packages?

Viewed 273

Does the conda uninstall and pip uninstall also removing dependencies for package that I am specifying in uninstall command but only ones that are not dependencies for any other currently installed packages?

2 Answers

The documentation for Conda remove isn't clear. It doesn't explicitly address the situation of whether shared dependencies are removed and the statement "--unless a replacement can be found without that dependency" only further confuses things.

This answer from Merv, if correct, indicates shared dependencies are not removed:

In the uninstallation, Conda...will attempt to remove the requested package, plus any of its dependencies that were not explicitly installed or required by other packages.

If you take a look at docs, the answer is easy to come by.

Conda remove man page plainly says:

This command will also remove any package that depends on any of the specified packages as well---unless a replacement can be found without that dependency. If you wish to skip this dependency checking and remove just the requested packages, add the '--force' option. Note however that this may result in a broken environment, so use this with caution.

pip uninstall on the other hand requires a -r option to delete package requirements.

Related