If a version of python is installed via pyenv with the --register flag then subsequently uv will fail to list python installs as it attempts to query metadata of a file that does not exist.
It looks like this is caused because uv makes the assumption that py --list-paths will return paths with only <major>.<minor> version information while pyenv installs are shown with <major>.<minor>.<micro>[^1]. The regex is then capturing the <micro> part of the version as part of the path to the python executable.
[^1]: It looks like py is just using the key names to get the version rather than the value of Version or SysVersion in the registry.
[^2]: This also lead to me finding out that pyenv-win registers 32bit python installs as 64bit which I've reported as a bug there.
If a version of python is installed via pyenv with the
--register
flag then subsequentlyuv
will fail to list python installs as it attempts to query metadata of a file that does not exist.It looks like this is caused because
uv
makes the assumption thatpy --list-paths
will return paths with only<major>.<minor>
version information while pyenv installs are shown with<major>.<minor>.<micro>
[^1]. The regex is then capturing the<micro>
part of the version as part of the path to the python executable.https://github.com/astral-sh/uv/blob/bbcd10d3cc7710b8c33955b91915e8463c2b6b9b/crates/uv-python/src/py_launcher.rs#L36-L39
Commands:
Full output:
Example of
py --list-paths
output with multiple versions of python installed and registered with pyenv and some regular installs.[^2][^1]: It looks like
py
is just using the key names to get the version rather than the value ofVersion
orSysVersion
in the registry. [^2]: This also lead to me finding out that pyenv-win registers 32bit python installs as 64bit which I've reported as a bug there.