From: Alex Corcoles Date: Fri, 1 Mar 2024 19:48:46 +0000 (+0100) Subject: Be more clear about the lack of necessity of activate X-Git-Tag: 20241020-emacs~267 X-Git-Url: https://xn--ix-yja.es/gitweb/?a=commitdiff_plain;h=184be5d489dc312558fc053c5753e41469440ad8;p=alex.git Be more clear about the lack of necessity of activate --- diff --git a/programming/python/python_modules_primer.md b/programming/python/python_modules_primer.md index 8932c19..d80b96d 100644 --- a/programming/python/python_modules_primer.md +++ b/programming/python/python_modules_primer.md @@ -260,7 +260,10 @@ $ . /bin/activate , and thus if you run `python`, `/bin/python` will be executed instead of `/usr/bin/python`. Besides changing your prompt to indicate the virtual environment is activated, `activate` only alters your `PATH`. -You can never use `activate` if you always specify the path to the virtual environment commands. +`activate` is not mandatory to use a virtual environment. +For example, when running the Python command, if you specify the path of the Python executable in a virtual environment, the command will execute as if the virtual environment had been activated. +Tools such as `poetry` have commands such as `poetry run` that can run commands inside a virtual environment without activating it. +Activation can save time, but it is also more error-prone than more explicit means of using virtual environments. ## Further reading