uv: `uv pip install --system` cannot create directory
- A minimal code snippet that reproduces the bug.
uv pip install --python 3.12 pre-commit
Resolved 10 packages in 44ms
error: Failed to install: cfgv-3.4.0-py2.py3-none-any.whl (cfgv==3.4.0)
Caused by: failed to create directory `/usr/local/lib/python3.12/dist-packages/cfgv-3.4.0.dist-info`
Caused by: Permission denied (os error 13)
- The current uv platform.
Ubuntu 22.04
- The current uv version (
uv --version
).
uv 0.1.12
pip defaults to .local/lib/python3.12/site-packages/
if the directory is not writeable
About this issue
- Original URL
- State: open
- Created 4 months ago
- Comments: 18 (11 by maintainers)
This was also requested here: https://github.com/astral-sh/uv/issues/1584. I’m more open to supporting
--user
than to doing this automatic fallback.(Aside: we plan to add
pipx
-like global installs for tools (https://github.com/astral-sh/uv/issues/1173). We actually have all the pieces we need to do this.)In case you don’t want to implement this automatic fallback, I think a more specific error message would be helpful (e.g. pointing to
--user
oruv venv
).Yeah, that’s something we want to transparently support in the future.
Definitely!