I am using the conda package manager - a lot. By now I have quite a few environments and a lot of downloaded packages taking a lot of space on my SSD. An obvious path to free so
You can free some space with:
conda clean --all
clean
Remove unused packages and caches.
Conda already use symlinks when possible for packages. So, not much to improve here, I guess.
Ok, thanks, but I would like to know "not for a specific environment, but in general" - for all environments.
You can list all packages in all envs with a few lines of Python:
import os
import subprocess
for env in os.listdir('/Users/me/miniconda3/envs'):
subprocess.call(['conda', 'list', '-n', env])
Finally I got around dealing with this issue. In the end it was a couple of days work:
conda env export > environment.yml
to save the settings of the environment from https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#exporting-the-environment-fileanaconda-clean
from option B in https://docs.anaconda.com/anaconda/install/uninstall and put the created backup in a save place.anaconda2
directory to anaconda2_backup
.miniconda3
in my case.environment.yml
s and check whether these work.Finally I also reduced my logical volume with https://blog.shadypixel.com/how-to-shrink-an-lvm-volume-safely/ but this is only for Linux users using LVMs.
This way I was able to free 20 to 30 GB of space.