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

fix(python plugin): set UV_PYTHON to python in .venv #2478

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yemaney
Copy link

@yemaney yemaney commented Jan 10, 2025

Fixes #2411

Summary

The UV_PYTHON env variables sets which python executable uv will use.

The current plugin sets the UV_PYTHON value to .devbox/nix/profile/default/bin/python which means uv pip install commands will try to install and save libraries under the .devbox/nix/profile/default/lib/python3.x/site-packages directory.

This will cause an error as the directory doesn't have write permissions because it exists under a folder that is a symlinked to a folder under the /nix/store path.

This change makes sure UV_PYTHON points to the python executable under .venv.
This will make uv pip install commands install libraries to the site-packages directory under .venv just like normal pip install would.

How was it tested?

  1. devbox create uvtest --template python-pip
  2. cd uvtest
  3. devbox add uv
  4. uv pip install fastapi

@mdomke
Copy link

mdomke commented Jan 21, 2025

It would be awesome to get this merged! All my Python projects suffer from this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Error installing python packages using uv
2 participants