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 fails to fetch latest version of package compatible with my environment's Python #9425

Open
sebastian-correa opened this issue Nov 25, 2024 · 3 comments
Labels
enhancement New feature or improvement to existing functionality

Comments

@sebastian-correa
Copy link

sebastian-correa commented Nov 25, 2024

When adding onnxruntime in Python 3.9, uv fails to resolve 1.19.2 and instead fails. onnxruntime 1.20.0 dropped support for Python 3.9. Could this be related to onnxruntime as poetry add also "fails" (it installs a wrong version and explodes in the process)?

To reproduce, do:

❯ mkdir onnxruntime-test
❯ cd onnxruntime-test
❯ uv init --python=3.9
Initialized project `onnxruntime-test`
❯ uv add --python=3.9 onnxruntime
Using CPython 3.9.20
Removed virtual environment at: .venv
Creating virtual environment at: .venv
Resolved 11 packages in 16ms
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

Running uv in macOS 15.1 (24B83). uv version is:

❯ uv --version
uv 0.5.4 (c62c83c37 2024-11-20)
@charliermarsh
Copy link
Member

charliermarsh commented Nov 25, 2024

I think the problem is that they don't have requires-python = ">=3.9", so from a metadata perspective, it "looks like" they still support Python 3.9. I could see us backtracking here, though, such that if there's no source distribution, we look for the next version with a matching wheel, if some Python versioning are missing.

In the meantime, you probably want to do something like:

[project]
...
dependencies = ["onnxruntime>=1.20.1 ; python_version > '3.9'", "onnxruntime<1.20.1 ; python_version <= '3.9'"]

@charliermarsh
Copy link
Member

This is roughly the same as #5182, but for Python version, not platform (which is more tractable).

@charliermarsh charliermarsh added the enhancement New feature or improvement to existing functionality label Nov 25, 2024
@sebastian-correa
Copy link
Author

Thanks for the reply! I figured it had something to do with this, and I tried to find the spot where they defined compatible Python versions but couldn't.

Can I help somehow? I don't know a single thing about rust or uv's inner workings but if I can be of help somehow, please let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants