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

Wrong info message shown for installation from URL #12928

Open
1 task done
lg8080 opened this issue Aug 21, 2024 · 3 comments
Open
1 task done

Wrong info message shown for installation from URL #12928

lg8080 opened this issue Aug 21, 2024 · 3 comments
Labels
C: logging Information Logging state: awaiting PR Feature discussed, PR is needed

Comments

@lg8080
Copy link

lg8080 commented Aug 21, 2024

Description

Pip gives the wrong error message "pip is looking at multiple versions of <package>" when a package is installed via a wheel file on the local file system or at a URL.

Expected behavior

The message "pip is looking at multiple versions of <package>" makes no sense, given the command issued. Pip should not state that it is looking at multiple versions of django in the example below.

pip version

24.2

Python version

3.12

OS

macOS

How to Reproduce

  1. Download a wheel file with dependencies, e.g. curl https://files.pythonhosted.org/packages/28/b4/110532cebfea2244d76119904da98c6fa045ebb202aee9ec7cbf36ea3cad/Django-5.1-py3-none-any.whl -o Django-5.1-py3-none-any.whl
  2. Disable your internet connection.
  3. pip install Django-5.1-py3-none-any.whl --no-cache

Output

$ pip install Django-5.1-py3-none-any.whl --no-cache
Processing ./Django-5.1-py3-none-any.whl
[…]
INFO: pip is looking at multiple versions of django to determine which version is compatible with other requirements. This could take a while.
[…]

Code of Conduct

@lg8080 lg8080 added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Aug 21, 2024
@notatallshaw
Copy link
Member

I can reproduce this, but it seems like a bit of an edge case, I get a lot of connection errors first:

$ pip install Django-5.1-py3-none-any.whl --no-cache --dry-run
Processing ./Django-5.1-py3-none-any.whl
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fd5736dad50>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/asgiref/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fd573fe9df0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/asgiref/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fd573520680>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/asgiref/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fd57350ac60>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/asgiref/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fd5735208c0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/asgiref/
INFO: pip is looking at multiple versions of django to determine which version is compatible with other requirements. This could take a while.
ERROR: Could not find a version that satisfies the requirement asgiref<4,>=3.8.1 (from django) (from versions: none)
ERROR: No matching distribution found for asgiref<4,>=3.8.1

I've not looked at the code flow, but I assume because asgiref can't be found the resolution algorithm backtracks on to django and looks for other versions to see if they don't have a dependency on asgiref, after not finding one a resolution error is thrown.

Maybe pip could exit early on the network errors. Or the wording of the error could be improved to account for the fact that pip isn't necessarily "looking at multiple versions" but "looking for other versions".

@lg8080
Copy link
Author

lg8080 commented Aug 22, 2024

Pip is not meant to look for other versions of django here, and I don't think pip does. In my view, the whole message should just not be printed, regardless of the wording. (And it should not "take a while" because there is nothing to be done.)

@notatallshaw
Copy link
Member

If a clear improvement can made here I'm sure a PR would be accepted.

@notatallshaw notatallshaw added C: logging Information Logging state: awaiting PR Feature discussed, PR is needed and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: logging Information Logging state: awaiting PR Feature discussed, PR is needed
Projects
None yet
Development

No branches or pull requests

2 participants