Skip to content

uv pip install --python=.venv/bin/python error: failed to create file /usr/.lock #2107

Closed
@gschaffner

Description

@gschaffner

here's a reproducer (latest is v0.1.13 at time of writing): cargo build --target=x86_64-unknown-linux-musl --features=vendored-libgit2,vendored-openssl and then

#!/usr/bin/env -S sh -c '< "$0" podman run --rm -i -v=./target/x86_64-unknown-linux-musl/debug/uv:/usr/bin/uv:ro --pull=newer docker.io/archlinux/archlinux bash "$@"'

shopt -s inherit_errexit
set -o errexit -o errtrace -o nounset -o pipefail -o xtrace

pacman --noconfirm -Syu sudo
useradd --create-home --groups=wheel user
echo '%wheel ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/wheel
<<'EOF' sudo -u user bash
    shopt -s inherit_errexit
    set -o errexit -o errtrace -o nounset -o pipefail -o xtrace

    cd ~
    sudo pacman --noconfirm -S python
    uv venv
    # uv pip install uv  # succeeds
    uv pip install --python=.venv/bin/python uv  # fails
EOF

this also reproduces on docker.io/debian:stable-slim. it also reproduces on my Arch Linux host if i remove pyenv from $PATH s.t. which python -> /usr/bin/python.

possibly the problem is that PythonEnvironment::from_requested_python is using the installation's (base) prefix for the root instead of using the venv's prefix? the following patchset seems to work: main...ea8257a

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions