Maurice LING <[EMAIL PROTECTED]> 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
... 
/usr/opt/lib/python2.4/site-packages
>>> 

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
/Library/Frameworks/Python.framework/Versions/<Version>/lib/...
but includes /opt/local/lib/python2.4/site-packages in sys.path.

    <mike
-- 
Mike Meyer <[EMAIL PROTECTED]>                  http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to