uv icon indicating copy to clipboard operation
uv copied to clipboard

Activate and deactivate venv (take uv to a next level of convenience)

Open bernd-wechner opened this issue 2 weeks ago • 1 comments

Summary

I think it would be awesome if uv remembered the last venv it created (as an environment variable, or in a dot file, it matters not, because the aim simply that afterward uv venv activate would activate it. A universal simple shortcut. And then uv venv deactivate would deactivate it. That woudl of course predicate activate and deactviate as keywords not venv names! I find that a livable compromise but am happy to hear other ideas.

In fact it goes one better, if it remembers the last venv it deactivated again, reactivation is a doddle.

To my mind this would remove my clunkiness form python venv management.

Example

uv venv activate uv venv deactivate

bernd-wechner avatar Nov 25 '25 07:11 bernd-wechner

have you looked at uv run? It manages the environment completely for you.

harshil21 avatar Nov 25 '25 08:11 harshil21

See https://github.com/astral-sh/uv/issues/1910 for something very similar, and the technical reasons why uv currently doesn't activate the venv for you.

konstin avatar Nov 26 '25 15:11 konstin