Downloading Python packages using the pip installer can be a pain in the ass mainly when you have to install the same packages in distinct "virtualenvs" and your Internet connection is slow or PyPI servers are quite busy. Anyway, caching is always a faster solution, right?
So, to deal with it I've setup
pip to cache each package downloaded by it. The most straight way to do it is by using the parementer
pip install --download-cache ~/.cache/pip django
But you don't want type this long command over and over... Well, so just set the environment variable
~/.cache/pip or to whatever you want.
I personally prefer setup it globally, by configuring
~/.pip/pip.conf with the content below:
1 2 3
# ~/.pip/pip.conf [global] download_cache = ~/.cache/pip