How to free disk space taken up by (ana)conda?

前端 未结 2 1657
独厮守ぢ
独厮守ぢ 2021-01-30 00:08

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

2条回答
  •  不要未来只要你来
    2021-01-30 00:31

    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])
    

提交回复
热议问题