-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
I just installed uv 0.3.0 using the installer script. This is on a Windows PC, with Python 3.8, 3.9, 3.10, 3.11 and 3.12 installed from the python.org installers. None of them have been added to sys.path, I use the py launcher (which by default selects the Python 3.12 installation). Apparently, I have the Windows Store version of Python 3.11 installed, but I never use it and it's not configured to be on my path by default (in "app execution aliases" I switched the "python.exe" and "python3.exe" aliases off).
With that background, if I write a small script sp.py as follows:
import sys
import os
print(f"{sys.executable=}")
print(f"{sys.path=}")
print(os.environ["PATH"].split(os.pathsep))
and run it using uv run sp.py, I get
❯ uv run sp.py
error: Failed to spawn: `python`
Caused by: program not found
(by the way, it would be nice to have a way to manually run the Python interpreter that uv run will invoke - uv run python would be the obvious candidate, but it would need to work even if Python is not on PATH by default).
I'm happy to provide more details as to my environment - I'm sure this is related to my configuration, which is far from typical. But I'm reluctant to reconfigure things to "fix the problem", as what I'm doing is valid, if unusual, and in particular it's a deliberate choice on my part to not have a python command on PATH by default, and use the py launcher for everything.