Post

I've just asked 3 AIs about the way to obtain, using the "uv" command, which is the version of the python runtime that is being used for the active virtual environment. I know I can use "python --version", but I was curious to see whether I could do everything with "uv".

1. Github Copilot (GPT-4.1) told me it was "uv python --version". I told it that a "--version" option didn't exist for "uv python", and that I was using uv version 0.8.17. Its response was that this "--version" option appeared in 0.1.0, so I needed to upgrade to that version 🤷

I reiterated that I used version 0.8.17, which is newer than 0.1.0 and, as a response, I obtained a lengthy explanation about how, contrary to what it seemed, 0.1.0 was in fact a newer version than 0.8.17 because the uv project had been rebooted after 0.8.0, back to 0.1.0 🤨

Interestingly, this explanation included a literal quote from the release notes explaining the reboot, and a link to such release notes where apparently I could verify that point myself. None of that was real. Version 0.8.17 was released five days ago.

2. So I asked Claude (Sonnet 4), and again it told me that I should use "uv python --version" (nope) and also that "uv python list" would give me a list of the installed python versions, indicating the currently active one (also nope on this last point).

I told it that "uv python --version" did not exist, and that I was using uv 0.8.17… and its response clarified that, in fact, the "uv python" subcommand had appeared in uv version 0.9.0, so I needed to upgrade 😕

So I explained that 0.8.17 was the latest version, released 5 days ago, and its response was that in such a case I should just use "python --version" without uv (OK, that's true, but I wanted a "uv" option). And again that "uv python list" would indicate the current one in the list (nope, nope).

0 reposts0 likes

3. So I asked Gemini (2.5 Flash), and this one told me that "uv python" without any arguments would give me the path of the python executable being used in the virtualenv. Which was incorrect again, as this only outputs the list of arguments that can be passed to it.

I explained that point at the chat, and then came the first thing similar to a "good" answer: use "uv python find", which will output the path of the python runtime, then pipe it to "xargs -L 1 -I {} {} -V" to execute it and extract the version ("-V").