-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow sync to install to system python #7748
Comments
See |
@zanieb maybe I am misunderstanding, but it appears as if UV_PROJECT_ENVIRONMENT wants the location of a virtualenv. The intent is not to tell UV to use an existing virtual environment, but to use the system directly. The docs also say:
This is not wanted. I would conclude that this feature request does not appear to be the same as the UV_PROJECT_ENVIRONMENT feature. |
You can use |
@zanieb I do have control over the environment. Its a docker container. |
Then why are you worried about packages being removed? Sorry, I must be missing something. |
In docker environments, it's quite common to install all python packages to the system. Virtual environments are not needed because the current project is the only thing installed.
The docker documentation for UV recommends that you use the venv entrypoint for all container commands:
However, this makes migrating to UV a bit harder when so many things already reference "python" directly in.
Also, using a virtual environment in these situations complicates the container, because devs now have to remember to use the .venv python always.
Would it be possible to install into the system during
uv sync
somehow. I assumed--python-preference only-system
would do this, but that doesn't seem to prevent the creating of a virtual environment.uv pip install
support--system
, so its sort of strange thatsync
does not.My current workaround is doing this in the dockerfile instead:
The text was updated successfully, but these errors were encountered: