Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uv should install packages without requiring a venv #1705

Closed
radupotop opened this issue Feb 19, 2024 · 2 comments
Closed

uv should install packages without requiring a venv #1705

radupotop opened this issue Feb 19, 2024 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@radupotop
Copy link

radupotop commented Feb 19, 2024

I'm installing packages inside a Docker container (via a Dockerfile) and wish to install them globally so that they're always available. This should be similar to running pip with root privileges. Unfortunately uv pip install doesn't let me install packages without an existing venv created via uv venv.

error: Failed to locate a virtualenv or Conda environment (checked: `VIRTUAL_ENV`, `CONDA_PREFIX`, and `.venv`). Run `uv venv` to create a virtualenv.      

This prevents the subsequent Python commands from running correctly. I have to source .venv/bin/activate for every docker RUN command.

RUN . $VIRTUAL_ENV/bin/activate \
    && python manage.py ...

Ideally uv would let me install packages globally.

Is there anything I can do to enable the venv globally? I've already set the VIRTUAL_ENV and the PATH env vars inside the Dockerfile.

Thanks.

@AlexWaygood
Copy link
Member

AlexWaygood commented Feb 19, 2024

Thanks for opening the issue and explaining the use case! Closing as a duplicate of #1526 / #1374

@AlexWaygood AlexWaygood closed this as not planned Won't fix, can't repro, duplicate, stale Feb 19, 2024
@zanieb zanieb added the duplicate This issue or pull request already exists label Feb 19, 2024
@kleinicke
Copy link

You can add a --system flag so it does not require a virtual environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants