-
Notifications
You must be signed in to change notification settings - Fork 739
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 sync: empty directories are assumed to be linked to non-existent interpreters #7212
Comments
Is just a bad error message assuming that the given directory either
We don't have a case for
So our special case error message about the interpreter not being properly linked is being shown when really it's just that we didn't find an interpreter in the expected location for a virtual environment and therefore the directory isn't a virtual environment. We should fix that, but why are you trying to place the virtual environment in an existing directory? So you can change the ownership of it? Why not let us create the directory? uv/crates/uv/src/commands/project/mod.rs Lines 385 to 390 in a8bd021
uv/crates/uv-python/src/environment.rs Lines 136 to 137 in 64e03ad
|
I was running in a few circles until I found In the end I found it worthwhile to report this behavior either way. I was a bit on the track trying to build as a user, so I left it but the original reason I got on said track was that the python interpreter landed in I guess with |
I've been experimenting a bit with
uv python
and Docker and it turns out it's systematically kinda awkward if you want non-root user and multi-stage.But one behavior seems a bug to me: in an attempt to install the python into the service user (called
app
), I'm trying to create a directory/app
as root, chown it to app and then switch toUSER app
before running sync.However, when I now try to run
uv sync
withUV_PROJECT_ENVIRONMENT=/app
, it reports:Basically it wrongly detects that an completely empty directory is linked to
/app/bin/python3
and tries to recreate it which fails, because it's not root.I've added an ls to be sure:
I've solved it with:
But that's a bit awkward. If I could use an empty directory, I wouldn't have to chown. Another option would be that uv doesn't delete the whole directory, but just the contents.
The text was updated successfully, but these errors were encountered: