mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
![]() The journey here can be seen in: - #4587 - #4589 - #4594 I collapsed all the commits here because only the last one in the stack got us to a "correct" error message. There are a few architectural changes: - We have a dedicated `MissingEnvironment` and `EnvironmentNotFound` type for `PythonEnvironment::find` allowing different error messages when searching for environments - `ToolchainNotFound` becomes a struct with the `ToolchainRequest` which greatly simplifies missing toolchain error formatting - `ToolchainNotFound` tracks the `EnvironmentPreference` so it can accurately report the locations checked The messages look like this now, instead of the bland (and often incorrect): "No Python interpreter found in system toolchains". ``` ❯ cargo run -q -- pip sync requirements.txt error: No virtual environment found ❯ UV_TEST_PYTHON_PATH="" cargo run -q -- pip sync requirements.txt --system error: No system environment found ❯ UV_TEST_PYTHON_PATH="" cargo run -q -- pip sync requirements.txt --python 3.12 error: No virtual environment found for Python 3.12 ❯ UV_TEST_PYTHON_PATH="" cargo run -q -- pip sync requirements.txt --python 3.12 --system error: No system environment found for Python 3.12 ❯ UV_TEST_PYTHON_PATH="" cargo run -q -- toolchain find 3.12 --preview error: No toolchain found for Python 3.12 in system path ❯ UV_TEST_PYTHON_PATH="" cargo run -q -- pip compile requirements.in error: No toolchain found in virtual environments or system path ``` I'd like to follow this with hints, suggesting creating an environment or using system in some cases. |
||
---|---|---|
.. | ||
python | ||
src | ||
Cargo.toml | ||
download-metadata.json | ||
fetch-download-metadata.py | ||
template-download-metadata.py |