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

uv add onnxruntime currently fails on MacOS #9228

Closed
reyammer opened this issue Nov 19, 2024 · 6 comments
Closed

uv add onnxruntime currently fails on MacOS #9228

reyammer opened this issue Nov 19, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@reyammer
Copy link

Hello,

Running uv add onnxruntime in a new uv repo currently fails on MacOS. The installation works with pip.

Commands:
$ uv init
$ uv add onnxruntime

Output:

error: Distribution `onnxruntime==1.20.0 @ registry+https://pypi.org/simple` can't be installed because it doesn't have a source distribution or wheel for the current platform

Platform: MacOS, 12.5

uv version: 0.5.2.

More context, which hopefully helps debugging:

  • pip install onnxruntime works; the catch seems to be that it installs onnxruntime 1.19.2.
  • I came across this problem while preparing a new release for magika (https://pypi.org/project/magika/0.6.0rc2/), see pyproject.toml; on MacOS, uv add magika==0.6.0rc2 fails (referencing "can't find a proper wheel for onnxruntime 1.20.0"). On the same platform pip install magika==0.6.0rc2 works (by picking onnxruntime 1.19.2). Another way to make it work is: uv add onnxruntime==1.19.2; uv add magika==0.6.2rc2).
  • I don't encounter these issues when testing on an ubuntu VM.

The gist of the problem seems to be that onnxruntime 1.20.0 is not compatible with the MacOS, but uv quits instead of trying with 1.19.2, which is compatible.

Happy to help debugging this, I'm a massive uv fan!

@charliermarsh
Copy link
Member

charliermarsh commented Nov 19, 2024

Ah yeah. This is working as intended right now. uv add will resolve for all platforms. But if a package is published without a source distribution, and the set of wheels doesn't cover all platforms, we won't know that when resolving. (In general, the set of wheels will never cover all platforms, since the set of platforms isn't fixed, so we basically assume that the wheels cover all platforms as long as they include the Python versions we care about.) I suggest adding a constraint for now, though the most relevant issue to track would be #5182.

@charliermarsh
Copy link
Member

(I'm going to combine with #5182 since it's ultimately the same problem as with PyTorch.)

@charliermarsh charliermarsh closed this as not planned Won't fix, can't repro, duplicate, stale Nov 19, 2024
@charliermarsh charliermarsh added the bug Something isn't working label Nov 19, 2024
@reyammer
Copy link
Author

Thanks for the very fast reply, I now understand the challenge. I will track the other gh issue and add a constraint for now. Thanks!

@charliermarsh
Copy link
Member

Thanks @reyammer. I promise it's a hard problem 😂 But I'd like to make the situation better here.

@reyammer
Copy link
Author

oh I fully believe you 😂 what confused me is that pip worked well this time, but given your note it seems there are cons in doing whatever pip is doing. Anyways, no big deal, added an upper bound for onnxruntime and everything now works as expected. Thanks again!

@msmygit
Copy link

msmygit commented Dec 5, 2024

I've the same problem as well with python 3.12,

error: Distribution `onnxruntime==1.20.1 @ registry+https://pypi.org/simple` can't be installed because it doesn't have a source distribution or wheel for the current platform

@reyammer I've kept the version at onnxruntime==1.19.2 to fix my problem. FWIW, I'm using python 3.12 in my app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants