-
Notifications
You must be signed in to change notification settings - Fork 648
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
--system doesn't work on Windows on Python <3.12 in GitHub Actions #2056
Comments
It appears to work fine on Python 3.12, but on Python 3.11/3.10 in CI, running
|
I've confirmed that this works as expected locally. If I install Python 3.10 from python.org, I can globally install binaries like |
It looks like the problem is that |
The problem is that we first look in
So that ends up returning the Python 3.12.2 interpreter that comes pre-bundled in the cache. |
I'm not sure how to fix this. Should we be looking in |
Yes, please look in PATH first as in the majority of scenarios the |
There's a PR open for it here: #2057. |
Do you have a link to the other issue? I'd like to read (but was focused on other things at the time). |
I know you mention this in your comment but I'm surprised because virtualenv does seem to do registry-based lookups before PATH. |
Nothing will be added to one's registry without an installer that does that. So for example if you build from source or use a prebuilt distribution and merely unpack then you have to just rely on PATH. |
Yes, that is true. However almost everyone enables that checkbox to add to PATH because you only install with that GUI if you're an average user and the vast majority of folks have no idea about the registry PEP (why would they) so in order to make it usable you check the box not even so much for external tools but so you have a The other, far far larger group, will install Python on servers. In this case they will disable the I have been exclusively a Windows user my entire life. I cannot express enough how few people use the In the official documentation, their example updates PATH https://docs.python.org/3/using/windows.html#installing-without-ui:
You will be hard-pressed to find code on GitHub (and in private) that does not rely on PATH. Some examples:
|
Yeah, having been exclusively a Windows user until very recently, I agree with basically everything @ofek is saying here |
`uv --system` is failing in GitHub Actions, because `py --list-paths` returns all the pre-cached Pythons: ``` -V:3.12 * C:\hostedtoolcache\windows\Python\3.12.2\x64\python.exe -V:3.12-32 C:\hostedtoolcache\windows\Python\3.12.2\x86\python.exe -V:3.11 C:\hostedtoolcache\windows\Python\3.11.8\x64\python.exe -V:3.11-32 C:\hostedtoolcache\windows\Python\3.11.8\x86\python.exe -V:3.10 C:\hostedtoolcache\windows\Python\3.10.11\x64\python.exe -V:3.10-32 C:\hostedtoolcache\windows\Python\3.10.11\x86\python.exe -V:3.9 C:\hostedtoolcache\windows\Python\3.9.13\x64\python.exe -V:3.9-32 C:\hostedtoolcache\windows\Python\3.9.13\x86\python.exe -V:3.8 C:\hostedtoolcache\windows\Python\3.8.10\x64\python.exe -V:3.8-32 C:\hostedtoolcache\windows\Python\3.8.10\x86\python.exe -V:3.7 C:\hostedtoolcache\windows\Python\3.7.9\x64\python.exe -V:3.7-32 C:\hostedtoolcache\windows\Python\3.7.9\x86\python.exe ``` So, our default selector returns the first entry here. But none of these are actually in `PATH` except the one that the user installed via `actions/setup-python@v5` -- that's the point of the action, that it puts the correct versions in `PATH`. It seems to me like we should prioritize `PATH` over `py --list-paths`. Is there a good reason not to do this? Closes: #2056
See AlexWaygood/typeshed-stats#200 for a repro. It's possible this is a just-in-GitHub Actions thing.
The text was updated successfully, but these errors were encountered: