plateform info.

Mike Meyer mwm at
Thu Sep 22 16:00:20 CEST 2005

Maurice LING <mauriceling at> writes:
> Is there a way of getting the path to the site-packages directory?

>>> import sys
>>> import os
>>> for dir in sys.path:
...   if os.path.split(dir)[-1] == 'site-packages':
...      print dir

But there's seldom a reason to want this.

> Considering that Mac OSX with Fink installs python libraries in
> /sw/lib/python<version>, Mac OSX itself has python libraries in
> /System/Library/Frameworks/Python.framework/Versions/<version>/lib, etc
> etc...

And darwinportgs puts them in
but includes /opt/local/lib/python2.4/site-packages in sys.path.

Mike Meyer <mwm at>
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

More information about the Python-list mailing list