astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
23.38k stars 671 forks source link

Windows 3.13t installation missing python.exe #8298

Open colesbury opened 3 days ago

colesbury commented 3 days ago
> uv run -p 3.13t python
error: Python interpreter not found at `C:\Users\Administrator\AppData\Roaming\uv\python\cpython-3.13.0+freethreaded-windows-x86_64-none\python.exe`

The installation directory has a python3.13t.exe, but no python.exe

This also affects other commands like uv venv.

zanieb commented 3 days ago

https://github.com/python/cpython/issues/112984#issue-2036766508 says

The installer should not include a python.exe, to avoid causing PATH conflicts, but Nuget, embeddable and Store packages should include a copy/alias.

so I guess we should add one in our installs? I wonder if we should do that upstream or here.

colesbury commented 3 days ago

My suggestion would be to rename the python3.13t.exe to python.exe in the indygreg/python-build-standalone build process, especially because the python-build-standalone Windows executables don't otherwise include the Python version numbers in their names.

zanieb commented 2 days ago

especially because the python-build-standalone Windows executables don't otherwise include the Python version numbers in their names.

As far as I know, we're just following the standard Windows build behavior there (not including version numbers), and it's proper for us to continue doing so for python3.13t.exe (which is the canonical name CPython uses here)

Since they suggest creating a copy, I think that's what I'll do? Exploring in https://github.com/indygreg/python-build-standalone/pull/373

zanieb commented 2 days ago

cc @zooba if you care to weigh in on what is best here.

colesbury commented 2 days ago

As a overall suggestion: I think you should be aiming for cross-platform consistency -- uv is a cross-platform product -- rather than consistency with parts of the CPython Windows installer (or macOS installer for that matter). People will expect that uv commands that work on Linux and macOS to also work on Windows.

For example, I think all of the following commands should work on all platforms:

uv run -p 3.10 python
uv run -p 3.10 python3.10

uv run -p 3.13t python
uv run -p 3.13t python3.13
uv run -p 3.13t python3.13t
zooba commented 2 days ago

Yeah, I largely agree with Sam here, cross-platform consistency is for the best. We only don't do that in the Windows installer because it's a change that will definitely break people, and I don't want to upset people more until we've actually got a sustainable path forward. uv is much closer to that vision than PATH modifications will ever be.

zanieb commented 2 days ago

Great thanks for the input! I'll rename it upstream — makes life a bit easier anyway.

I'm not sure what the best approach will be to address your uv run examples, but generally agree with the philosophy that the commands should be portable across platforms.

Thanks again @colesbury for following up on our handling of these distributions, there are definitely some quirks to be ironed out.