adding new paths to sys.path

Peter Hansen peter at engcorp.com
Fri Mar 7 08:29:59 EST 2003


Alex Martelli wrote:
> 
> > On Fri, Mar 07, 2003 at 12:57:07PM +0800, Jon Perez wrote:
> >> What do I change to get these new package paths
> >> added to the default paths searched by Python
> >> when running a script?
> 
> 0) add a textfile /usr/lib/python2.2/site-packages/whatever.pth
> including the single line:
> /usr/local/lib/python2.2/site-packages
> 
> Name 'whatever' is arbitrary, it's the .pth extension that matters.

I always like to point out that even under Windows, the "pth" 
extension *must* be lowercase, as the relevant code does not do 
a case-insensitive comparison.

-Peter




More information about the Python-list mailing list