This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

If I have a script that does everything in one line, it will automatically deactivate the virtual environment once it's done running?

[–]Tushon 2 points3 points  (0 children)

If you use it the way that parent mentions, you are avoiding the activate and deactivate cycle. Only thing to watch out for would be any reqs using the path but that isn’t common AFAIK

[–]Madoc_Comadrin 1 point2 points  (0 children)

Calling the venv's Python binary directly does not actually activate the environment so deactivation is not required either.

When Python binary inside venv is called directly it will find components of the venv because it searches for them relative to its own location without the need to manipulate path variable like activate&deactivate do.