title: How to find out the Python library installation path?
body: <p>For installing third-party Python packages I have used a setup.py script that uses setuptools.setup() to install a bunch of packages. After the installation I can find these packages on one machine under /usr/local/lib/python2.7/dist-packages and on another machine under /usr/lib/python2.7/site-packages.</p>
  
  <p>Now I want to write a Python script that finds out where the third-party packages have been installed. How can I do that?</p>
  
  <p>1) sys.prefix=sys.exec_prefix is on both machines "/usr".</p>
  
  <p>2) The python executable is on both machines /usr/bin/python.</p>
  
  <p>3) distutils.sysconfig.get_python_lib() is /usr/lib/python2.7/dist-packages ("local" is missing) on one machine and /usr/lib/python2.7/site-packages on the other machine.</p>