Support for --user
installations in non-root container environments
#12291
Labels
enhancement
New feature or improvement to existing functionality
Summary
Description
uv
assumes that users will always want to operate inside a.venv
directory by default, which is generally reasonable. However, in my development setup, this assumption creates friction.I am using the VS Code Dev Container extension, operating inside a Debian-based container (
python:bookworm
). Following best practices, I avoid running the container as root and instead created a non-root user (moby
) for my local development.Since I am already isolated inside a container, using a virtual environment inside it is redundant. I'd like to install packages directly to my user environment (e.g.,
/home/moby/.local/[bin|lib]
), butuv sync
will always create a.venv
directory if none exists, with no available CLI option to bypass this behavior.I noticed that
uv pip install
recently introduced a--system
flag, but this still defaults to/usr/local
which requires root, making it unsuitable for non-root container workflows like mine.Requested Feature
I’d like to propose the addition of a
--user
flag for bothuv pip
anduv sync
commands that:.venv
creation.$HOME/.local/[bin|lib]
.This would align
uv
withpip install --user
behavior, making it much more flexible for containerized, non-root development environments.Example Dockerfile for context:
Why this matters
uv
assumes either root access or.venv
usage.--user
option would streamline workflows for developers working in secure, non-root, containerized setups.Current workaround
At the moment, my only option is to avoid
uv sync
oruv pip install
, and manually rely on a traditional, slower, but reliablepip install
.The text was updated successfully, but these errors were encountered: