`uv pip install` and `uv pip sync` both perform each uninstall twice causing the second one to fail
I'm running into some really strange behavior where running uv pip install causes each package to be uninstalled twice, causing a missing RECORD file error on the second uninstall. Considering I'm not passing --reinstall it shouldn't even do a single uninstall.
As far as I can tell it doesn't cause any real issues and is still a lot faster than pip this way, but it is very noisy.
I'm on Linux x86_64 (OpenSUSE Tumbleweed) with uv 0.1.28
uv pip install uv --verbose
Details
INFO Found a virtualenv through VIRTUAL_ENV at: /home/david/git/ocqms/venv
DEBUG Cached interpreter info for Python 3.10.14, skipping probing: venv/bin/python
DEBUG Using Python 3.10.14 environment at venv/bin/python
DEBUG Using registry request timeout of 300s
DEBUG Solving with target Python version 3.10.14
DEBUG Adding direct dependency: uv*
DEBUG Found fresh response for: https://pypi.org/simple/uv/
DEBUG Ignoring installed versions of uv: multiple distributions found
DEBUG Searching for a compatible version of uv (*)
DEBUG Ignoring installed versions of uv: multiple distributions found
DEBUG Selecting: uv==0.1.28 (uv-0.1.28-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/bf/23/e65d0f8cd4d9904a82a616c265bb30ccc802b16226b964e9f668da26dc2b/uv-0.1.28-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
Resolved 1 package in 2ms
DEBUG Preserving seed package: pip==23.0.1
DEBUG Preserving seed package: setuptools==69.2.0
DEBUG Preserving seed package: pip==23.0.1
DEBUG Preserving seed package: setuptools==69.2.0
DEBUG Uninstalled uv (11 files, 3 directories)
warning: Failed to uninstall package at venv/lib64/python3.10/site-packages/uv-0.1.28.dist-info due to missing RECORD file. Installation may result in an incomplete environment.
Installed 1 package in 63ms
- uv==0.1.28
- uv==0.1.28
+ uv==0.1.28
To me it looks like uv gets confused by there being both a lib and lib64 folder, the latter of which is a symbolic link to the former. As soon as I remove the symbolic link uv starts to behave normally. Having lib64 as an alias for lib inside virtual environments is an OpenSUSE thing as far as I am aware.
Oh interesting. Thanks for raising!
@zanieb - Perhaps when we iterate over site_packages, we filter out symlinks, not just duplicate paths...?
@Daverball I put up https://github.com/astral-sh/uv/pull/2806 if you want to give it a try — I'm having a hard time constructing a test case.
I was able to reproduce in a container.
Fixed (with a test) in https://github.com/astral-sh/uv/pull/3002.