Skip to main content

get_python_path

Function get_python_path 

Source
pub fn get_python_path() -> Result<PathBuf, ErrReport>
Expand description

Locate a Python 3 interpreter, in order of preference:

  1. If uv is available, use uv python find to get the Python path.
  2. Otherwise, try python and check it is not Python 2.
  3. Fall back to python3 if python is Python 2 (or absent).

Returns an error only if none of the above yields a usable Python 3.