Finding modules in subdirectories of sys.path

Norm Wood norm at wombat.atmos.colostate.edu
Wed Aug 22 17:42:09 EDT 2001


Hi,

I've installed the NumPy extensions and Scientific Python package into
subdirectories of my home directory:

/home/me/lib/python2.0/Numeric
/home/me/lib/python2.0/Scientific


The Scientific directory contains a number of subdirectories (Physics,
Statistics, etc.).  It appears that, in order to import modules from
these subdirectories, each subdirectory has to be listed explicitly
in sys.path.  Otherwise, I get an import error.

Is it possible to cause python to search recursively through the
directories rooted at /home/me/lib/python2.0?  Or is it possible
to place some sort of index in /home/me/lib/python2.0 so that python
can locate the modules within the subdirectories without explicitly
listing each subdirectory in sys.path?

Thanks,

Norm Wood

-- 
Norm Wood

     Department of Atmospheric Science
     Colorado State University
     norm at atmos.colostate.edu
     phone:  970-491-3334



More information about the Python-list mailing list