gpt4 book ai didi

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

转载 作者:IT老高 更新时间:2023-10-28 22:15:35 24 4
gpt4 key购买 nike

使用 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

我看到这种特殊情况可能是由于 URL 中的协议(protocol)更改引起的(新要求使用 git://,而已经安装的要求使用 https://)。

但是,我想知道如果我选择其中一个选项(切换、忽略、删除、备份)会发生什么。我在 pip 文档中找不到解释。

最佳答案

解释此选项的补丁已 merge 到 PIP 文档中,但直到 Pip 6.0 (2014-12-22) 才发布。 (https://github.com/pypa/pip/commit/b5e54fc61c06268c131f1fad3bb4471e8c37bb25)。补丁是这样写的:

--exists-action option

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 promptwhen decision is needed.

  • (s)witch

    Only relevant to VCS checkout. Attempt to switch the checkoutto the appropriate url and/or revision.

  • (i)gnore

    Abort current operation (e.g. don't copy file, don't create archive,don't modify a checkout).

  • (w)ipe

    Delete the file or VCS checkout before trying to create, download, or checkout a new one.

  • (b)ackup

    Rename the file or checkout to {name}{'.bak' * n}, where n is some numberof .bak extensions, such that the file didn't exist at some point.So the most recent backup will be the one with the largest number after .bak.

这里是现在更新的文档中该选项描述的链接:https://pip.pypa.io/en/stable/cli/pip/#exists-action-option .

关于python - 使用 pip 从存储库安装软件包时,(s)witch、(i)gnore、(w)ipe、(b)ackup 选项是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19276818/

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