uv Python setup fails on Windows: "spawn uv ENOENT" after fresh uv install

Open Beginner friendly
#15,835 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python, typescript

Research direction

Start in extensions/positron-python/src/client/pythonEnvironments/common/environmentManagers/uvPythonInstaller.ts at installPythonVersionAndGetPath(), then compare its uv calls with callers using UvUtils and uvUtils.command. Done means fresh Windows installs can run both uv Python commands through the resolved binary after installation, avoiding spawn ENOENT.

Written by the indexing model from the issue text.

Description

area: interpreter bug lang: python os-windows support

When Positron installs uv for the user and then tries to install a Python version, the install step fails with Failed to install Python 3.14: Error: spawn uv ENOENT even though uv installed successfully moments earlier. This happens mostly because uv isn't on the path yet.

Reported via reddit:

https://www.reddit.com/r/RStudio/comments/1vybexp/question_on_positron_and_python_failed_to_install/

Root cause

installPythonVersionAndGetPath() in extensions/positron-python/src/client/pythonEnvironments/common/environmentManagers/uvPythonInstaller.ts calls execUv with the literal command 'uv':

execUv('uv', ['python', 'install', installTarget], ...)
execUv('uv', ['python', 'find', version], ...)

Every other uv call routes through UvUtils, which locates the binary and uses the resolved path (uvUtils.command, e.g. ~\.local\bin\uv.exe). Right after a fresh install, uv is not on the running extension host's PATH -- the installer only updates shell rc / registry PATH, which the already-running process doesn't pick up. So the bare 'uv' spawn fails with ENOENT, while the resolved absolute path works.

Evidence (from the user's log)

> uv --color never python dir                    (bare 'uv' probe -> fails, falls back)
> ~\.local\bin\uv.exe --color never python dir   (resolved path -> works)
> ~\.local\bin\uv.exe --color never python list  (resolved path -> works)
Installing Python 3.14 via uv...
> uv --color never python install 3.14           (bare 'uv' -> ENOENT)
Failed to install Python 3.14: Error: spawn uv ENOENT

The bare-'uv' probe already failing (and the fallback to ~\.local\bin\uv.exe succeeding) confirms uv is not on this session's PATH.

Note: this is not strictly "uv" vs "uv.exe" -- bare 'uv' would resolve fine if it were on PATH. The bug is that this one code path uses the literal 'uv' instead of the located binary path that the rest of the flow already resolved.

Fix (suggested)

Use the resolved uv command in installPythonVersionAndGetPath instead of the literal 'uv' (route through the located UvUtils / uvUtils.command, same as the other callers). The existing comment there says it avoids installUvPython "to avoid cache issues," but resetUvCache() has already run after install, so the located command is current -- the resolved path can be used safely.

Platform: Windows. Not reproducible where uv is already on PATH.

Dominant language
TypeScript
Stars
4.3k
Forks
184
Avg merge
1d 5h
Merged PRs (30d)
186

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from posit-dev/positron

All issues in posit-dev/positron

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.