Determines the path to the uv executable by checking a fixed and explicit
sequence of locations.
Details
The lookup is performed in the following order:
If the
UVenvironment variable is set and non-empty, its value is used as the path touv.Otherwise, the system
PATHis searched usingSys.which("uv").If
uvis still not found, the following OS-specific fallback locations are checked, in order:On Windows:
%USERPROFILE%\\.local\\bin\\uv.exe%LOCALAPPDATA%\\uv\\uv.exe%USERPROFILE%\\.cargo\\bin\\uv.exe
On macOS and other Unix-like systems:
~/.local/bin/uv~/.cargo/bin/uv
If none of these checks succeed, NULL is returned.
Setting the UV environment variable allows users to explicitly control
which uv executable is used. This is useful when multiple installations
are present or when uv is installed in a non-standard location that is not
on the system PATH.