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

前端 未结 2 1654
独厮守ぢ
独厮守ぢ 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:35

    Finally I got around dealing with this issue. In the end it was a couple of days work:

    1. For all my Python projects I use PyCharm and with it I checked which project uses which environment. For all environments I used the 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-file
    2. Check whether my projects still work with new environments created from the environment.yml.
    3. Use anaconda-clean from option B in https://docs.anaconda.com/anaconda/install/uninstall and put the created backup in a save place.
    4. Rename the old anaconda2 directory to anaconda2_backup.
    5. Install a new conda environment - miniconda3 in my case.
    6. Build new environments which are need for current projects from the environment.ymls and check whether these work.
    7. Delete the old anaconda backups.

    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.

提交回复
热议问题