uv icon indicating copy to clipboard operation
uv copied to clipboard

`uv run` can fail to invoke `python`

Open zanieb opened this issue 1 year ago • 5 comments

❯ uv run --isolated -v crates/uv-python/fetch-download-metadata.py
DEBUG uv 0.2.21
warning: `uv run` is experimental and may change without warning.
DEBUG Running `python crates/uv-python/fetch-download-metadata.py`
error: Failed to spawn: `python`
  Caused by: No such file or directory (os error 2)

zanieb avatar Jul 03 '24 15:07 zanieb

What's going on here? Hah

charliermarsh avatar Jul 03 '24 15:07 charliermarsh

Should we use the absolute path to the Python interpreter that we found?

charliermarsh avatar Jul 05 '24 22:07 charliermarsh

Or are we not adding it to PATH, maybe?

charliermarsh avatar Jul 05 '24 22:07 charliermarsh

Hmm, no, we do add the scripts directory to PATH which should include python...

charliermarsh avatar Jul 05 '24 22:07 charliermarsh

My suspicion here, without investigating further, is that we didn't create an environment (since there are no requirements) and tried to invoke python outside of one?

zanieb avatar Jul 05 '24 23:07 zanieb

Yeah this makes sense. It's kinda the same as https://github.com/astral-sh/uv/issues/4846.

charliermarsh avatar Jul 06 '24 19:07 charliermarsh