简体   繁体   English

使用 pip 从存储库安装软件包时,(s)witch、(i)gnore、(w)ipe、(b)ackup 选项是什么意思?

[英]What do (s)witch, (i)gnore, (w)ipe, (b)ackup options mean when installing a package from repository using pip?

When installing a package using pip, I get the following message:使用 pip 安装软件包时,我收到以下消息:

Obtaining some-package from git+git://github.com/some-user/some-package.git@commit-hash#egg=some_package-dev (from -r requirements.txt
 (line 3))
  git clone in /Users/me/Development/some-env/src/some-package exists with
 URL https://github.com/some-user/some-package.git
  The plan is to install the git repository git://github.com/some-user/some-package.git
What to do?  (s)witch, (i)gnore, (w)ipe, (b)ackup

I see that this particular case is probably caused by a change of protocol in URL (new requirement uses git:// , while the one already installed uses https:// ).我看到这种特殊情况可能是由 URL 中的协议更改引起的(新要求使用git://git://安装的要求使用https:// )。

However, I wonder what exactly happens if I choose either of the choices (switch, ignore, wipe, backup).但是,我想知道如果我选择其中一个选项(切换、忽略、擦除、备份),究竟会发生什么。 I'm unable to find an explanation in pip documentation.我无法在 pip 文档中找到解释。

A patch explaining this option was merged into the PIP documentation, but it was not released until Pip 6.0 (2014-12-22).解释此选项的补丁已合并到 PIP 文档中,但直到 Pip 6.0 (2014-12-22) 才发布。 ( https://github.com/pypa/pip/commit/b5e54fc61c06268c131f1fad3bb4471e8c37bb25 ). https://github.com/pypa/pip/commit/b5e54fc61c06268c131f1fad3bb4471e8c37bb25 )。 Here is what that patch says:这是该补丁的内容:

--exists-action option --exists-action 选项

This option specifies default behavior when path already exists.此选项指定路径已存在时的默认行为。 Possible cases: downloading files or checking out repositories for installation, creating archives.可能的情况:下载文件或检出存储库进行安装,创建档案。 If --exists-action is not defined, pip will prompt when decision is needed.如果--exists-action ,则 pip 将在需要决定时进行提示。

  • (s)witch (s)女巫

    Only relevant to VCS checkout.仅与 VCS 结帐相关。 Attempt to switch the checkout to the appropriate url and/or revision.尝试将结帐切换到适当的 url 和/或修订版。

  • (i)gnore (i) 忽略

    Abort current operation (eg don't copy file, don't create archive, don't modify a checkout).中止当前操作(例如,不要复制文件、不要创建存档、不要修改签出)。

  • (w)ipe (w) ipe

    Delete the file or VCS checkout before trying to create, download, or checkout a new one.在尝试创建、下载或签出新文件之前删除文件或 VCS 签出。

  • (b)ackup (b) 备份

    Rename the file or checkout to {name}{'.bak' * n} , where n is some number of .bak extensions, such that the file didn't exist at some point.将文件或检出重命名为{name}{'.bak' * n} ,其中 n 是一些.bak扩展名,因此该文件在某些​​时候不存在。 So the most recent backup will be the one with the largest number after .bak .因此,最近的备份将是.bak之后编号最大的备份。

And here is a link to description of that option in the now-updated documentation: https://pip.pypa.io/en/stable/cli/pip/#exists-action-option .这是现在更新的文档中对该选项的描述的链接: https : //pip.pypa.io/en/stable/cli/pip/#exists-action-option

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 安装 package numcodecs 时出错。 我该怎么办? - Error when installing the package numcodecs. What do I do? 使用PIP从Github安装Python包 - Installing Python Package from Github Using PIP 使用Pip安装Python包时如何使用MinGW的gcc编译器? - How to use MinGW's gcc compiler when installing Python package using Pip? 适用于anaconda环境的错误点子版本。 使用“ conda activate”激活环境时,我该怎么做才能更正点子版本? - Wrong pip version for anaconda's environments. What should I do to correct the pip version when activate a env using `conda activate`? 如何使用pip从Bitbucket安装软件包? - How do I install a package from Bitbucket using pip? 从 git 安装 pip 包时,如何知道使用了哪个提交? - How can I know which commit was used when installing a pip package from git? 使用 pip 从 pypi 安装软件包时,有没有办法排除特定版本? - Is there a way to exclude a specific version when installing a package from pypi using pip? 安装软件包时,此pip错误是什么意思? - What does this pip error means when installing a package? 当我使用 pip 安装任何软件包时出现 WinError 10013 - WinError 10013 when I use pip for installing any package 从PIP安装软件包时,使用专用存储库/服务器 - While installing package from PIP it using private repo/server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM