While inside a Python virtual environment I can execute which python to get the path of the interpreter.
Once I get the path of the interpreter, I can find the site-packages library following some simple steps
- Get the interpreter path using which python, this will lead to something like/my/interp/full/path/bin/python
- cdto one level above, so we'll be at- /my/interp/full/path
- cdto- lib, now wer'e at- /my/interp/full/path/lib
- Assume there is only one directory in the current directory, which will be called python3.x, the value ofxdepends on the version andcdinto it, now we're at/my/interp/full/path/lib/python3.8
- site-packageswill be inside this directory
So what I'm trying to achieve is some kind of shell command/script that will use which python and will output the full path to the site-packages directory
Example of input->output:
If the output of which python is /home/asdasd/zxczxc/qweqwe/bin/python
the output should be /home/asdasd/zxczxc/qweqwe/lib/python3.8/site-packages/
I'm looking for a bash solution, not Python code
 
    