Free Bitcoins

INFO: Clear Anaconda (Conda) Cached Packages

One of the things that boosted my productivity in the development of Python scripts is having been introduced to the jupyter notebook development environment. If you have not been introduced to jupyter (or ipython) notebooks, you might want to take a look at it and see how it could be used in your working environment.

I am using it most of the time that in order for me to quickly launch the jupyter environment on my computer, I integrated it as part of the right-click context of my desktop. You may want to check out the post I created for it titled, Customized Right-Click Menu.

Just recently, I noticed a growing disk size on the system drive of my notebook. The SSD originally installed in it has limited space, so I could not help but notice the change. SSDs are pretty much "limited" in size, as the price-per-gigabyte has not gone up to pace with the economies of scale unlike its spinning cousin. Given that, I need to control the usage.

One of the culprits to the disk hogging is the Anaconda3 (jupyter notebook is part of Anaconda) installed. I originally installed the full-suite, rather than the lean Miniconda3. Lesson learned on that aspect but I'm too lazy to re-install and reconfigure the packages. Over time, Anaconda3 updates are installed, but the original packages downloaded are still cached and need to be cleaned.

This is the default behavior, and the only rational that could explain this is that if you need to backout of an updated package, the cached package previously installed still exists. These pile up over time and need to be manually deleted.

The command to execute on a privileged terminal, is:
conda clean --packages
And executing takes you to a view similar to the image below.

conda clean --packages

As you can see from the screenshot, 1.15GB of downloaded packages are sitting by waiting to be cleaned. Simply press "Y" and the process completes. The answer to that question is almost always "Y" so the command could be modified to non-interactive.
conda clean --packages --yes
Pressing "Y" to continue the image above brings..

Note that this will only remove the cached packages and not remove the installed packages.

RELATED: Customized Right-Click Menu

You may also set a task to automatically do this for you periodically, as another alternative (set it and forget it). The non-interactive option comes in handy in this scenario. Hope this helps 'conda users in squeezing more space from their SSD drives.

Post a Comment

Subscribe for Latest Update

Popular Posts

Blog Archives