Reputation: 117
I have to do some cleanup with my (Mini)conda python packages to free some disk space, and I see people usually resort to the conda clean
command to get this job done. Conda documentation says that it it's safe to do that, as it will only erase packages that "have never been used in any environment".
I've never used conda's environments feature, though, and I don't know if I should be doing so. I just install my packages with conda install
commands, run Jupyter Notebook and do all my work inside Jupyter. (I'm not a software engineer, just a regular dude using python and pandas to manage data.)
Do I risk erase my favorite packages if i run conda clean
? If I don't do any cleanup, will conda eventually engulf all of my disk space? Is there any command I can use to check how much disk space my python packages are taking.
Upvotes: 8
Views: 12389
Reputation: 406
If your "favourite packages" have been used earlier , they will not be deleted !
Also , conda clean has a variety of options for you to go through .Click here for more information on it.
Usually conda packages are small and use less than 100 Mb of space ( most of them , tensorflow uses around 460 Mb , so there are a few like these as well )
Also , if you have trouble in managing space , you could always shrink down some of the packages you have . Click here for more information.
Upvotes: 2
Reputation: 76750
At the very least, tarballs can be removed with no risk. Cleaning packages is done based on counting the number of hardlinks for the package. If there is only one hardlink, this implies the package is not referenced by any environment, and therefore can be removed. This will be the case for all packages that were previously in use but were superseded by other versions.
The warning mainly applies to people who have environments across different disks but are using softlinks to limit redundancy. Unlike hardlinks, the file system does not keep track of softlink references, so there is no simple way to count the number of softlinks. Hence, when cleaning, those packages that are only connected to envs through softlinks (i.e., only report one hardlink) will be removed and thereby break the softlinking envs.
Upvotes: 10