-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 tool install posting
failed with Python version conflict
#6381
Comments
Thanks Darren! This is an interesting one. We should probably find a way respect the |
Ah interesting. We determine the interpreter to use before we resolve the package because we need the markers to perform resolution. |
I guess we could just... download the version and try again with the known requirements instead of failing. I don't think it'd be too slow since it's a rare case. |
+1, this is important for me too! i encountered this problem with |
I think I'm experiencing a bug with this in uv 0.4.21. For me, uvx is not respecting the But it can be boiled down to the following: $ uv init --app --package example-packaged-app --python 3.11
$ cd example-packaged-app/
$ uv run example-packaged-app
Using CPython 3.11.4 interpreter at: C:\Users\User\AppData\Local\Programs\Python\Python311\python.exe
Creating virtual environment at: .venv
Built example-packaged-app @ file:///C:/Users/User/Projects/test/example-packaged-app
Installed 1 package in 16ms
Hello from example-packaged-app!
Note how it uses Python 3.13.0, even though the |
I assumed uv at least looked at the I uninstalled Python 3.13 and then for a project which specifies
Seems like a small quality of life improvement to check at least the tool being installed (even if not all it's dependencies) and download the appropriate Python? But maybe I'm oversimplifying the work that would be required. |
Yeah we should fix this. |
@notatallshaw that's roughly the idea that was pursued in #7827 |
I think the "holistic" solution is probably something like: do a solve with no Python constraints, then install a version in the specified range. |
Firstly, thanks for the amazing work here. This project is incredibly exciting, and I hope the whole community gets onboard.
Earlier today I installed
uv
(version 0.3.0) using the recommended approach in the docs. I ranuvx posting
and received an error roughly along the lines of "the current Python version is 3.10 and posting requires >=3.11, so the constraint could not be satisfied".This was surprising, as I expected
uv
to automatically download and install a suitable Python for me (I have not touched any config at all - installinguvx posting
was the first thing I tried after installinguv
). My understanding was the "current" Python version is irrelevant.I then ran
uv install python 3.11
and repeateduvx posting
, and it worked as expected.I was using an M1 Macbook Pro at the time. I cannot reproduce this issue on a different Intel Macbook Pro.
Unfortunately I don't have access to the machine I encountered this on right now and couldn't report at the time, but can probably add more information soon if required.
The text was updated successfully, but these errors were encountered: