问题
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?
回答1:
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.
回答2:
The difference between
conda clean --yes --all
and
conda clean --yes --packages
is that the packages are only the extracted folders. All of the other files (.tar.bz2, .conda, that is: tarballs) are not cleaned by --packages.
If you want to clean only the tarballs, you would need
conda clean --yes --tarballs
References: Anaconda Python: Delete .tar.gz in pkgs
来源:https://stackoverflow.com/questions/36308531/how-to-uninstall-all-unused-packages-in-a-conda-virtual-environment