uv/crates/uv-python
konsti 364e3999d4
Improve error message when a virtual environment Python symlink is broken (#12168)
When removing a Python interpreter underneath an existing venv, uv
currently shows a not found error:

```
error: Failed to inspect Python interpreter from active virtual environment at `.venv/bin/python3`
  Caused by: Python interpreter not found at `/home/konsti/projects/uv/.venv/bin/python3`
```

This is unintuitive, as the file for the Python interpreter does exist,
it is a broken symlink that needs to be replaced with `uv venv`.

I've been encountering those occasionally, and I expect users that
switch between versions a lot will, too, especially when they also use
pyenv or a similar Python manager.

The new error hints at this solution:

```
error: Failed to inspect Python interpreter from active virtual environment at `.venv/bin/python3`
  Caused by: Broken symlink at `.venv/bin/python3`, was the underlying Python interpreter removed?

hint: To recreate the virtual environment, run `uv venv`
```
2025-05-07 13:24:53 -05:00
..
python Fix GraalPy abi tag parsing and discovery (#12154) 2025-03-13 23:55:07 +00:00
src Improve error message when a virtual environment Python symlink is broken (#12168) 2025-05-07 13:24:53 -05:00
.gitignore minify and filter embed managed pythons json on compile time (#12967) 2025-04-30 15:51:03 -04:00
build.rs Only rebuild download JSON on change (#13261) 2025-05-02 07:49:34 -05:00
Cargo.toml minify and filter embed managed pythons json on compile time (#12967) 2025-04-30 15:51:03 -04:00
download-metadata.json Add downloading of GraalPy (#13172) 2025-05-06 11:02:27 -05:00
fetch-download-metadata.py Add downloading of GraalPy (#13172) 2025-05-06 11:02:27 -05:00