Skip to content

Add more detail on platform mismatch errors#13988

Open
sepehr-rs wants to merge 4 commits into
pypa:mainfrom
sepehr-rs:add-detail-mismatch
Open

Add more detail on platform mismatch errors#13988
sepehr-rs wants to merge 4 commits into
pypa:mainfrom
sepehr-rs:add-detail-mismatch

Conversation

@sepehr-rs
Copy link
Copy Markdown
Member

Fixes #5003

When pip can't find a matching distribution, it now shows why each available distribution was rejected. This replaces the old unhelpful message "No matching distribution found for X" with a summary of skipped candidates, grouped by rejection reason.

Example:

(pip) sepehr@debian:~/w/pip$ pip install numpy==1.19.0 --target linux_aarch64 --only-binary=:all:
ERROR: Ignored the following yanked versions: 2.4.0
ERROR: Could not find a version that satisfies the requirement numpy==1.19.0 (from versions: 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.2.0, 2.2.1, 2.2.2, 2.2.3, 2.2.4, 2.2.5, 2.2.6, 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.4.0rc1, 2.4.1, 2.4.2, 2.4.3, 2.4.4)
Skipped 3802 unsuitable distribution(s)
  183: unsupported format
    - numpy-1.0.1.dev3460.win32-py2.4.exe
    - numpy-1.3.0.tar.gz
    - numpy-1.3.0.win32-py2.5.exe
    ... and 180 more
  3619: incompatible platform/tags
    - numpy-1.5.1-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.whl
    - numpy-1.6.0-cp26-cp26m-manylinux1_x86_64.whl
    - numpy-1.6.0-cp26-cp26mu-manylinux1_x86_64.whl
    ... and 3616 more
ERROR: No matching distribution found for numpy==1.19.0

One limitation is that printing every rejected candidate makes the output grow very quickly (over 3,000 lines in the example above), and this caused several tests to fail. Because of that, verbose mode currently shows the same summarized output instead of listing every rejected candidate individually.

I’d welcome any feedback on whether this trade‑off seems reasonable, and whether it would be useful to expose the full list of rejected candidates in some other way (for example behind a separate flag or with additional safeguards).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add more detail on platform missmatch errors instead of just declaring not matching distributions found

1 participant