gpt4 book ai didi

python - pip 的 `--no-cache-dir` 有什么用?

转载 作者:IT老高 更新时间:2023-10-28 20:25:03 24 4
gpt4 key购买 nike

我最近看到在 Docker 文件中使用了 --no-cache-dir。我以前从未见过那个标志,帮助没有解释它:

 --no-cache-dir              Disable the cache.
  1. 问题:什么是缓存?
  2. 问题:缓存是做什么用的?
  3. 问题:我为什么要禁用它?

最佳答案

  1. 缓存是:隐藏起来或以备将来使用
  2. 用于
  • 存储你通过pip安装的模块的安装文件(.whl等)
  • 保存源文件(.tar.gz等),避免过期重新下载
  1. 可能的原因您可能想要禁用缓存:
  • 您的硬盘空间不足
  • 以前使用 unexpected 设置运行 pip install
    • 例如:
      • 之前运行 export PYCURL_SSL_LIBRARY=nsspip install pycurl
      • 想要新运行 export PYCURL_SSL_LIBRARY=opensslpip install pycurl --compile --no-cache-dir
  • 您希望 Docker 镜像尽可能小

文档链接

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

关于python - pip 的 `--no-cache-dir` 有什么用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45594707/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com