3 ms·
> I had to learn by heart Can you not write shell scripts on Darwin? > source .venv/bin/activate # Activate the virtual environment This is a convenience, no
by zahlman 1y ago
> I had to learn by heart
Can you not write shell scripts on Darwin?
> source .venv/bin/activate # Activate the virtual environment
This is a convenience, not a necessary step. All it does is manipulate a few environment variables. You can just specify the paths to the venv's pip and Python explicitly.
(Of course, you can script around the expectation of those environment variables, if you prefer that workflow.)
Also, pip 22.3 added the ability to install cross-environment, which allows for creating virtual environments much faster `--without-pip` (see e.g. https://zahlman.github.io/posts/2025/01/07/python-packaging-2/ https://zahlman.github.io/posts/2025/01/07/python-packaging-...).
> [sudo] rm -fR .venv
I can't fathom a reason you'd ever need sudo for this cleanup.