How to remove all unused packages in conda virtual environment?

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

What is the easiest way to clear it so that only packages that are actually used by my code remain and the rest are removed?

+6
source share
1 answer
 conda clean --yes --all 

will disinfect everything. But note: if you ever want to perform any --offline operation, do not use --all ; be more selective.

+8
source

All Articles