]> xn--ix-yja.es Git - alex.git/commitdiff
Be more clear about the lack of necessity of activate
authorAlex Corcoles <alex@pdp7.net>
Fri, 1 Mar 2024 19:48:46 +0000 (20:48 +0100)
committerAlex Corcoles <alex@corcoles.net>
Fri, 1 Mar 2024 20:27:11 +0000 (20:27 +0000)
programming/python/python_modules_primer.md

index 8932c19f7f230d4c86d56df1acc6ebdffcd0596b..d80b96d34ab97c23901c26fea1621dca88725275 100644 (file)
@@ -260,7 +260,10 @@ $ . <some path>/bin/activate
 , and thus if you run `python`, `<some path>/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