-
Notifications
You must be signed in to change notification settings - Fork 853
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
[Feature Request] Add uv venv --activate
to activate virtual environment after creation
#8106
Comments
Unfortunately we can't do this because of how shells work. You need to run the activation command from your shell, a subprocess cannot mutate your shell. |
Something related to this request that is probably not worth creating a separate issue. Remembering the activation script location is confusing when switching between Windows and Linux systems. Windows makes it even worse with separate scripts for PowerShell and Command Prompt. E.g.
Sometimes it would be useful get the activation script path directly from source $(uv venv foobar --activation-script)
# Leading to
# source "foobar/bin/activate" Since Nothing I personally require - just something that came to mind while reading this post. |
This is also what PDM went with, i.e., a command to print the activate command for your current OS and shell. |
@zanieb |
Poetry is removing their |
See #1910 |
I suggest that uv add an
--activate
option to theuv venv
command. This option would automatically activate the virtual environment after creating it.The following would be mostly equivalent:
Currently,
uv venv
has the following output:This should be replaced by the following, but only with
--activate
:The text was updated successfully, but these errors were encountered: