-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Support copy or hardlink python interpreter when creating venv #6782
Comments
This makes sense to me. |
Minor note, this is included as |
Sometimes, I want to package the Python source code and the virtual environment (venv) together for direct distribution. In this case, the interpreter should not be a symbolic link, but a full copy of the original interpreter. and I hope to have an option for this. |
Running into this also - basically the docker case but the applications current make use of |
I think the alternative is you just copy over the interpreter along with the environment. |
any updates here? Would really like to have this functionality! |
Me as well, please 💟 We use the official Docker images to setup Python environments with 'uv'. But later on, we need to run the actual scripts under a different Docker image. The way with having a combined image (donor 'uv' executable) does not really scale, as you would need to build one image per combination of Python interpreter version and Linux distro 🙈 . |
+1 for this, for a different use case. Using uv virtual environments with Cursor, Cursor appears to follow the symlink and give me the wrong environment. I'm also following up to see if it's something I can fix within Cursor, but I've had no luck so far. |
Same in vscode, at least for me. |
Currently, when creating a venv,
uv
always symlinks the python interpreter. Example:The original
python -m venv
supports either symlink or copy (with--symlinks
/--copies
flag). It would be great ifuv
also supported the same, similar to how--link-mode
exists foruv pip
.My main use case is for using a docker multi-stage build where one of the stages builds the venv and then other stages can just copy the entire venv folder; example Dockerfile:
This use case currently breaks as the symlink ends up pointing to a python binary that does not exist in the final image. For this use case, the ideal behavior would be that the main
/venv/bin/python
binary was copied or hardlinked from the external binary andpython3
/python3.12
continued to be relative symlinks.Tested on uv version 0.4.0.
The text was updated successfully, but these errors were encountered: