pip的`--no-cache-dir`有什么用? [英] What is pip's `--no-cache-dir` good for?

查看:2798
本文介绍了pip的`--no-cache-dir`有什么用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近看到Docker文件中使用了--no-cache-dir.我以前从未见过该标志,并且帮助没有对其进行解释:

I've recently seen the --no-cache-dir being used in a Docker file. I've never seen that flag before and the help is not explaining it:

 --no-cache-dir              Disable the cache.

  1. 问题:缓存了什么?
  2. 问题:缓存的用途是什么?
  3. 问题:我为什么要禁用它?
  1. Question: What is cached?
  2. Question: What is the cache used for?
  3. Question: Why would I want to disable it?

推荐答案

  1. 已缓存:隐藏存储或将来使用
  2. 用于
    • 存储通过pip安装的模块的安装文件(.whl等)
    • 存储源文件(.tar.gz等),以避免在未到期时重新下载
  1. Cached is: store away in hiding or for future use
  2. Used for
    • store the installation files(.whl, etc) of the modules that you install through pip
    • store the source files (.tar.gz, etc) to avoid re-download when not expired
  • 您的硬盘驱动器上没有空间
  • 以前使用意外设置运行pip install
    • 例如:
      • 以前运行export PYCURL_SSL_LIBRARY=nsspip install pycurl
      • 要重新运行export PYCURL_SSL_LIBRARY=opensslpip install pycurl --compile --no-cache-dir
      • you don't have space on your hard drive
      • previously run pip install with unexpected settings
        • eg:
          • previously run export PYCURL_SSL_LIBRARY=nss and pip install pycurl
          • want new run export PYCURL_SSL_LIBRARY=openssl and 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

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

          这篇关于pip的`--no-cache-dir`有什么用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆