-
Notifications
You must be signed in to change notification settings - Fork 765
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
On Windows, uv run
fails with "error: Failed to spawn: python
"
#6348
Comments
Thank you for the thorough report! I believe we've talked about this before... I'm surprised we didn't fix it. |
The problem here is fairly obvious, @charliermarsh should have a fix up soon. uv/crates/uv/src/commands/project/run.rs Line 777 in f10ccc4
|
Serious déjà vu but turns out I only fixed this for pager: #5198 |
Thanks! Just over half an hour from report to fix - impressive 🙂 |
If it doesn't fix it please feel welcome to ping here... I was able to replicate something similar on macOS but of course it's not totally identical to your setup. |
Will do - I'll probably have to wait for a release as I don't have the time at the moment to build from source, but I'll check as soon as I can. |
Releases also come fast around these parts: https://github.com/astral-sh/uv/releases/tag/0.3.1 |
I no longer get the error (which is great, thanks @charliermarsh) but (On an unrelated note, I'd uninstall the Store version, if it wasn't for the fact that it acts as a really useful test case for issues like this...) At a minimum, I would expect the latest installed (and registered as per PEP 514) version of Python to be used by default, regardless of source. It would be more consistent if the behaviour of the |
On further investigation, if I switch off the app execution alias for That almost matches the docs here, which say:
However, the earlier note about the "system Python" says
which suggests that While I don't think it's necessary for the documentation to give every detail of the discovery process, this presumes that discovery is intuitive - and IMO, defaulting to an older version of Python when there's no Again, I concede that this is a weird edge case caused by my specific config. I almost certainly should not have set things up so that I had I've now switched off the |
There's an issue tracking PEP 514 support at #1521
This makes sense to me. I think the problem is we look for all valid Python executable names on the PATH one directory at a time. Instead, |
Understood. As I say, my configuration is (was) unusual - it's not normal to have just the versioned |
I just installed uv 0.3.0 using the installer script. This is on a Windows PC, with Python 3.8, 3.9, 3.10, 3.11 and 3.12 installed from the python.org installers. None of them have been added to
sys.path
, I use thepy
launcher (which by default selects the Python 3.12 installation). Apparently, I have the Windows Store version of Python 3.11 installed, but I never use it and it's not configured to be on my path by default (in "app execution aliases" I switched the "python.exe" and "python3.exe" aliases off).With that background, if I write a small script
sp.py
as follows:and run it using
uv run sp.py
, I get(by the way, it would be nice to have a way to manually run the Python interpreter that
uv run
will invoke -uv run python
would be the obvious candidate, but it would need to work even if Python is not onPATH
by default).I'm happy to provide more details as to my environment - I'm sure this is related to my configuration, which is far from typical. But I'm reluctant to reconfigure things to "fix the problem", as what I'm doing is valid, if unusual, and in particular it's a deliberate choice on my part to not have a
python
command onPATH
by default, and use thepy
launcher for everything.The text was updated successfully, but these errors were encountered: