[Tutor] Location of modules in Mac OS X

Kent Johnson kent37 at tds.net
Mon Oct 1 20:28:25 CEST 2007


Roy Chen wrote:
> Hello all,
> 
> I'm using MacPython 2.5 on OS X 10.4.
> 
> I was just wondering if all the Python modules are contained in this  
> directory:
> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/

Try

import sys
sys.path

That will give you a list of all the places Python will search for 
modules. There are several ways this list can be customized, including
PYTHONPATH environment variables
.pth files
site-customize.py
modifying sys.path in a program

so you shouldn't treat this as a final definitive list, rather it is a 
snapshot of current usage.

Kent


More information about the Tutor mailing list