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

Using UV to manage the system installation #8126

Closed
guillemc23 opened this issue Oct 11, 2024 · 3 comments
Closed

Using UV to manage the system installation #8126

guillemc23 opened this issue Oct 11, 2024 · 3 comments
Labels
question Asking for clarification or support

Comments

@guillemc23
Copy link

guillemc23 commented Oct 11, 2024

I don't think that this is an issue, it's most likely a question.

In my case, I am using the GDAL official docker image that already comes with its bindings and Python packages properly installed. I would like to use UV to manage this system's Python installation and to add other packages on top of it. I have seen the flag --system but I'm not certain what it does, it definitely doesn't let me to do this.

For example, the system's installation has the gdal package properly installed but not pandas, so I would like to use UV to install pandas on the system's installation and run my scripts without the need for creating a virtual environment.

I have tested as well setting the following environment variables:

ENV UV_SYSTEM_PYTHON "true"
ENV UV_PYTHON_PREFERENCE "only-system"

But still, when I run uv run --frozen python main.py, it creates a virtual environment instead of running over the system instalation. This also happens when running uv sync 🤔

FYI: GDAL is a geospatial set of tools that are usually quite tedious to install, so using the official docker image is a practical way to do so, better than just starting from the Python image and installing GDAL to it

@Super1Windcloud
Copy link

I think that you can uv pip install --system

@guillemc23
Copy link
Author

guillemc23 commented Oct 14, 2024

What about running something using the system python?

@charliermarsh charliermarsh added the question Asking for clarification or support label Oct 14, 2024
@charliermarsh
Copy link
Member

You can set UV_PROJECT_ENVIRONMENT to a system interpreter -- see here: #6834 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

3 participants