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

venv: --copies? #2103

Open
gkze opened this issue Mar 1, 2024 · 6 comments
Open

venv: --copies? #2103

gkze opened this issue Mar 1, 2024 · 6 comments
Labels
enhancement New feature or improvement to existing functionality

Comments

@gkze
Copy link

gkze commented Mar 1, 2024

Got it to compile on Nix (was a pain because of openssl-sys :) ). Now the problem is the venv being constructed with symlinks instead of copies. Would it make sense to have a --copies/--symlinks a la venv? Or symlink the core installation and write installed packages to the venv instead of the system directory?

@charliermarsh charliermarsh added the enhancement New feature or improvement to existing functionality label Apr 7, 2024
@Vigilans
Copy link
Contributor

I am mounting my home directory to devcontainer to reuse my user configs, and I have a venv dedicated for my user. Without --copies to create a self contained venv, the user-wide venv may not find the python through the symlink, or symlinked to different version in the devcontainer.

@konstin
Copy link
Member

konstin commented May 27, 2024

We're now supporting uv venv --link-mode copy, which will copy the installed packages, even though we're still symlinking the python interpreter.

@zanieb
Copy link
Member

zanieb commented Jul 1, 2024

Is this still an issue because we're not copying the interpreter? Should we respect --link-mode for the interpreter too?

@SecT0uch
Copy link

SecT0uch commented Sep 13, 2024

Is this still an issue because we're not copying the interpreter? Should we respect --link-mode for the interpreter too?

I'm trying to resolve an issue where .venv in subfolders are not aromatically detected by vscode and saw that comment microsoft/vscode-python#14592 (comment)

I'm not sure this is the source of my issue, but I wanted to try a copy with the interpreter included

@wkrettek
Copy link

I used uv to bootstrap python for an old embedded armv7 platform that had no python3 or package manager. My goal was to create a venv folder that was portable enough such that I could deploy it to this platform multiple times without internet or needing the uv binary installed.

I tried forcing it by copying the interpreter into my venv folder but it seemed like some libraries were still linked or missing. I eventually set my UV_PYTHON_INSTALL_DIR to install in my project directory and created a new venv so it looked like this

project_dir
|- cpython-3.12.7-linux-armv7-gnueabihf/
|- venv/
|- my_python_script.py

This is the closest I could get to a portable project when bootstrapping with uv. If it's possible to build a venv that has copies of the interpreter and its libraries together I would be forced to sing uv's praises from the mountaintops.

@eabase
Copy link

eabase commented Feb 25, 2025

This is also in line with my proposal in #11773

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality
Projects
None yet
Development

No branches or pull requests

8 participants