astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
24.9k stars 721 forks source link

Tools break (understandably) after upgrading system Python #8514

Open akx opened 1 week ago

akx commented 1 week ago

I ran a long-overdue brew upgrade on my system yesterday, and since python@3.12 3.12.4 -> 3.12.7_1, I knew I'd have to nuke my venvs (which is related to #1495 – since my venvs are in ~/venvs, I don't need to hunt them around my project folders...) since the base interpreter is gone.

uv tools also break (though pipx-installed tools haven't broken! I suppose pipx doesn't fully resolve a symlink Python executable and just uses /opt/homebrew/bin/python3.12 instead of /opt/homebrew/Cellar/python@3.12/3.12.7_1/Frameworks/Python.framework/Versions/3.12/bin/python3.12?), and uv tool list doesn't make it perfectly easy to recover:

$ uv tool list
Python interpreter not found at `/Users/akx/Library/Application Support/uv/tools/jupyter-core/bin/python3`
Python interpreter not found at `/Users/akx/Library/Application Support/uv/tools/pre-commit/bin/python3`
Python interpreter not found at `/Users/akx/Library/Application Support/uv/tools/segno/bin/python3`

Happily, I have Fish shell history to help me, so I knew to uv tool install segno --with qrcode-artistic and uv tool install pre-commit --with pre-commit-uv (and get rid of Jupyter, that was just for testing).

$ uv tool list
pre-commit v4.0.1
- pre-commit
segno v1.6.1
- segno

Ideas:

zanieb commented 1 week ago

I believe this is a duplicate of #1640 (which we are attempting to address in #8419 via #8481)

There's also some related issues