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

Show 'closest' tag in tag incompatibility error messages #10534

Closed
wants to merge 5 commits into from

Conversation

charliermarsh
Copy link
Member

Summary

Here's an example from torch on my M3:

  × No solution found when resolving dependencies:
  ╰─▶ Because only the following versions of torch are available:
          torch==1.0.0
          torch==1.0.1
          torch==1.1.0
          torch==1.2.0
          torch==1.3.0
          torch==1.3.1
          torch==1.4.0
          torch==1.5.0
          torch==1.5.1
          torch==1.6.0
          torch==1.7.0
          torch==1.7.1
          torch==1.8.0
          torch==1.8.1
          torch==1.9.0
          torch==1.9.1
          torch==1.10.0
          torch==1.10.1
          torch==1.10.2
          torch==1.11.0
          torch==1.12.0
          torch==1.12.1
          torch==1.13.0
          torch==1.13.1
          torch==2.0.0
          torch==2.0.1
          torch==2.1.0
          torch==2.1.1
          torch==2.1.2
          torch==2.2.0
          torch==2.2.1
          torch==2.2.2
          torch==2.3.0
          torch==2.3.1
          torch==2.4.0
          torch==2.4.1
          torch==2.5.0
          torch==2.5.1
      and torch<=2.4.1 has no wheels with a matching Python ABI tag (e.g., `cp313`), we can conclude that torch<=2.4.1 cannot be used.
      And because torch>=2.5.0 has no wheels with a matching platform tag (e.g., `macosx_14_0_arm64`) and you require torch, we can conclude that your requirements are unsatisfiable.

      hint: Wheels are available for `torch` (v2.4.1) with the following ABI tags: `cp38`, `cp39`, `cp310`, `cp311`, `cp312`. The closest match is `cp312-none-macosx_11_0_arm64`.

      hint: Wheels are available for `torch` (v2.5.1) on the following platform: `manylinux1_x86_64`. The closest match is `cp313-cp313-manylinux1_x86_64`.

@charliermarsh charliermarsh added the error messages Messaging when something goes wrong label Jan 12, 2025
let Ok(abi) = AbiTag::from_str(abi) else {
continue;
};
for (wheel, _) in &self.0.wheels {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really, really inefficient... It's O(M*N) where M is the number of compatible tags and N is the number of wheels. But like... it will only run once, in the error reporting, so I think it's kind of fine?

Try to thread through

Add errors

Iterate on tags

Add ABI Tag

Add impls

Use context instead
if let Some((py, abi, platform)) = closest {
write!(
f,
"{}{} Wheels are available for `{}` ({}) with the following ABI tag{s}: {}. The closest match is `{}`.",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @konsti had a nice suggestion, to say something like: "A wheel exists for a different architecture" (#2777 (comment))

hint: Wheels are available for `open3d` (v0.18.0) on the following platforms: `macosx_11_0_x86_64`, `macosx_13_0_arm64`, `manylinux_2_27_aarch64`, `manylinux_2_27_x86_64`, `win_amd64`
hint: Wheels are available for `open3d` (v0.18.0) on the following platforms: `macosx_11_0_x86_64`, `macosx_13_0_arm64`, `manylinux_2_27_aarch64`, `manylinux_2_27_x86_64`, `win_amd64`. The closest match is `cp310-cp310-win_amd64`.
Copy link
Member

@zanieb zanieb Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure these help.

In this example, I get confused by the additional tags (e.g., cp310). Maybe it'd be helpful as "The closest match to your platform (e.g., ...) is ...", but I'm not sure I follow the user experience this solves.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separately, how is cp310-cp310-win_amd64 the closest match to manylinux_2_17_x86_64?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should probably be cp310-cp310-manylinux_2_27_x86_64 . You don't find that helpful?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. Maybe if I also had a Python compatibility error? I'm just not sure what I could do with that information, and a quick scan of the available tags is already showing where I've gone wrong.

What does knowing the closest tag change? Does it make a particular action clearer?

hint: Wheels are available for `package-a` (v1.0.0) on the following platform: `macosx_10_0_ppc64`
hint: Wheels are available for `package-a` (v1.0.0) on the following platform: `macosx_10_0_ppc64`. The closest match is `py3-none-macosx_10_0_ppc64`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine one wheel platform is rare, but should we show a closest match in this case?

@charliermarsh charliermarsh force-pushed the charlie/abi branch 2 times, most recently from f521ff4 to 614965b Compare January 14, 2025 00:51
Base automatically changed from charlie/abi to main January 14, 2025 01:03
@charliermarsh
Copy link
Member Author

Just gonna close this. Other more impactful things to improve in these errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Messaging when something goes wrong
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants