diff options
| author | Alex Corcoles <alex@pdp7.net> | 2024-03-01 20:48:46 +0100 |
|---|---|---|
| committer | Alex Corcoles <alex@corcoles.net> | 2024-03-01 20:27:11 +0000 |
| commit | 184be5d489dc312558fc053c5753e41469440ad8 (patch) | |
| tree | 0df3c96eab9de8f89c8d12195fd68f14539675eb | |
| parent | 002a3e937fcbd32df31b12a5da04c1e0ac82812a (diff) | |
Be more clear about the lack of necessity of activate
| -rw-r--r-- | programming/python/python_modules_primer.md | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/programming/python/python_modules_primer.md b/programming/python/python_modules_primer.md index 8932c19f..d80b96d3 100644 --- a/programming/python/python_modules_primer.md +++ b/programming/python/python_modules_primer.md @@ -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 |
