How do I find the location of my Python site-packages directory?

PythonServer Side ProgrammingProgramming

You can find the location of Python site-packages directory by using the site module in the following way −

>>> import site
>>> site.getsitepackages()
['/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']

If you want the per user site packages directory, then run the following code in your shell −

$ python -m site --user-site
raja
Published on 27-Dec-2017 11:49:49
Advertisements