What is pip `--no-cache-dir` for?

I recently saw how it is --no-cache-dirused in a Docker file. I have never seen this flag before, and help doesn't explain it:

 --no-cache-dir              Disable the cache.
  • Question: What is cached?
  • Question: What is the cache used for?
  • Question: Why do I want to disable it?
+63
source share
4 answers
  1. Cached : Store in stash or for future use.
  2. Is used for
    • save installation files ( .whletc.) of modules that you install via pip
    • keep source files ( .tar.gzetc.) to avoid reloading if not expired
  3. :
    • pip install
      • :
        • export PYCURL_SSL_LIBRARY=nss pip install pycurl
        • export PYCURL_SSL_LIBRARY=openssl pip install pycurl --compile --no-cache-dir

https://pip.pypa.io/en/stable/reference/pip_install/#caching  - @emredjan https://pip.pypa.io/en/stable/reference/pip_install/ - @mikea

+50

, --no-cache-dir Docker. Docker, , .

+10

pip - pip , , , root.

, Amazon AMI chroot - pip , , , AMI. , ssh , , .ssh .

- , pip , , .

+7

, DockerFile python, / .

+1

All Articles