Skip to main content

resolve_canonical_python_bin

Function resolve_canonical_python_bin 

Source
pub fn resolve_canonical_python_bin() -> String
Expand description

Resolve the canonical Python binary path — the single interpreter ALL ML components install into.

Resolution order:

  1. MLSTACK_PYTHON_BIN / UV_PYTHON — an explicit user override always wins (respects user intent; e.g. pinning a specific interpreter).
  2. The managed global env (~/.mlstack/global/bin/python) if it exists — the deterministic single source (Stage 0). Installers create it on first global install via ensure_global_venv.
  3. Active virtualenv
  4. uv-managed Python (preferred for ML workloads)
  5. System Python

Falls back to "python3" if no interpreter is found.