Stop PIP from re-downloading same packages over and over again

Jun 07, 2014 · by Tim Kamanin

PIP has a habit of re-downloading same packages every time you hit pip install package_name. That's not so cool, especially, when you deploy packages from requirements.txt and one of the packages failed to build, restarting pip install -r requirements.txt would lead pip to re-download all the packages again.

Thankfully there's a way to fix this easily: create a configuration file named ~/.pip/pip.conf, and add the following contents:

[global] download_cache = ~/.cache/pip 

That's all, since that very moment, pip will start to cache downloaded files in ~/.cache/pip and won't re-download them every time it needs them.

Want to get more 🔥 tips like this one?

Subscribe to get notified about new dev tutorials