Stop PIP from re-downloading same packages over and over again07 Jun · by Tim Kamanin · 1 min read
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.