How do you prevent PIP from re-downloading previously downloaded packages? I’m testing the install of matplotlib, an 11MB package that depends on several distro-specific packages. Everytime I run pip install matplotlib, it re-downloads matplotlib. How do I stop this?
How do you prevent PIP from re-downloading previously downloaded packages? I’m testing the install
Share
You can use a specific environment variable PIP_DOWNLOAD_CACHE and make it point to a directory where your packages will be stored. If they are to be installed again, they will be taken from this directory.
There seems to be also an additional option for PIP
pip --download-cachewhich ought to do something similar, but I have never tried it myself. For your example, to avoid re-downloadingmatplotlibevery time, you would do the following:Does that answer your question?