Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to uninstall all unused packages in a conda virtual environment?

I have a conda virtual environment with several unused packages installed inside it (either using pip install or conda install).

What is the easiest way to clean it up so that only packages that are actually used by my code remain, and the others are uninstalled?

like image 458
Erwin Mayer Avatar asked Mar 30 '16 12:03

Erwin Mayer


People also ask

How do you clean unused packages conda?

What is the easiest way to clean it up so that only packages that are actually used by my code remain, and the others are uninstalled? You might want to take a look at conda clean --packages . In particular, you could try it with the "dry-run" setting first -- i.e. conda clean --packages --dry-run .

How do I remove all packages installed by conda?

You can't uninstall all packages in base because that's where the conda executable lives. Instead, what you want to do is uninstall all user-installed packages.

Does removing conda environment remove all packages?

Remove a list of packages from a specified conda environment. 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.


1 Answers

conda clean --yes --all 

will sanitize everything. But take note: if you ever want to do any type of --offline operations, don't use --all; be more selective.

like image 136
kalefranz Avatar answered Sep 29 '22 10:09

kalefranz