![](/static/253f0d9b/assets/icons/icon-96x96.png)
![](https://programming.dev/pictrs/image/1d99f7cb-50e7-4994-94c4-fd23f30209b7.png)
Just in case this comment didn’t make it explicitly clear, you can just invoke the python binary inside your venv directly and it will automatically locate all the libraries that are installed in your virtual environment.
To show how this works, you can look at the sys.path
variable to see which paths python will search for modules when you run import statements. Try running python3 -c 'import sys; print(sys.path)'
using your system python, and you will only see system python library paths. Then, try running it again after replacing python3
with the full path to the python3
binary in your venv, and you will see an additional entry in the output with the lib
directory in your venv, which shows that python will also look there for modules when an import statement is executed.
I doubt that you’re interested in arguing in good faith, but if by some miracle you do care about having an informed opinion before opening your mouth, how would you respond to things like this?