When installing a package using pip, I get the following message:
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://
).
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 is a standard package manager used to install and maintain packages for Python. The Python standard library comes with a collection of built-in functions and built-in packages.
The --user flag to pip install tells Pip to install packages in some specific directories within your home directory. This is a good way to have your own default Python environment that adds to the packages within your system directories, and therefore, does not affect the system Python installation.
The name pip is [an] acronym and declaration: pip installs packages. ( Source) Package management is so important that Python's installers have included pip since versions 3.4 and 2.7. 9, for Python 3 and Python 2, respectively. Many Python projects use pip , which makes it an essential tool for every Pythonista.
pip is a package management system used to install and manage software packages written in Python. Many packages can be found in the default source for packages and their dependencies — Python Package Index (PyPI).
A patch explaining this option was merged into the PIP documentation, but it was not released until Pip 6.0 (2014-12-22). (https://github.com/pypa/pip/commit/b5e54fc61c06268c131f1fad3bb4471e8c37bb25). Here is what that patch says:
--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 prompt when decision is needed.
(s)witch
Only relevant to VCS checkout. Attempt to switch the checkout to 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 number of.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
.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With