Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade pip using pip.exe raises an error if the requirement already satisfied #6924

Closed
atugushev opened this issue Aug 26, 2019 · 2 comments · Fixed by #6928

Comments

@atugushev
Copy link
Contributor

@atugushev atugushev commented Aug 26, 2019

Environment

  • pip version: 19.3.dev0, master since d2b7082
  • Python version: any
  • OS: Windows

Description

Currently modifying pip on Windows using pip.exe raises an error and suggests to upgrade it using module invocation python -m pip install ...:

ERROR: To modify pip, please run the following command:
C:\Python36\python.exe -m pip install --upgrade pip

But if the requirement is already satisfied or up-to-date it still raises the same error:

Requirement already satisfied: pip in c:\python36\lib\site-packages (19.3.dev0)
ERROR: To modify pip, please run the following command:
C:\Python36\python.exe -m pip install pip

Expected behavior

The command shouldn't raise the error if the requirement is up-to-date:

> pip install pip
Requirement already satisfied: pip in c:\python36\lib\site-packages (19.3.dev0)

How to Reproduce

  1. Get package from git+git://github.com/pypa/pip@d2b708#egg=pip
  2. Then run pip install pip
  3. An error occurs.

Output

> python -m pip install --upgrade git+git://github.com/pypa/pip@master#egg=pip==19.3.dev0
Collecting pip==19.3.dev0 from git+git://github.com/pypa/pip@master#egg=pip==19.3.dev0
  Cloning git://github.com/pypa/pip (to revision master) to c:\users\appveyor\appdata\local\temp\1\pip-install-t406pky0\pip
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
Installing collected packages: pip
  Found existing installation: pip 18.1
    Uninstalling pip-18.1:
      Successfully uninstalled pip-18.1
  Running setup.py install for pip: started
    Running setup.py install for pip: finished with status 'done'
Successfully installed pip-19.3.dev0

> pip install pip
Requirement already satisfied: pip in c:\python36\lib\site-packages (19.3.dev0)
ERROR: To modify pip, please run the following command:
C:\Python36\python.exe -m pip install pip

Additional context

This issue came out of the discussion in PR #6864 (comment).

@atugushev

This comment has been minimized.

Copy link
Contributor Author

@atugushev atugushev commented Aug 26, 2019

@chrahunt could you please assign this issue to me, i'd like to work on it?

@chrahunt

This comment has been minimized.

Copy link
Member

@chrahunt chrahunt commented Aug 26, 2019

Done!

@lock lock bot added the S: auto-locked label Oct 7, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.