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?
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 .
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With