how do i add a new path into sys.path?

Peter Hansen peter at
Fri Aug 19 14:35:04 CEST 2005

Steve Holden wrote:
> The method I outlined works only for the duration of a single program 
> run, because the sys.path variable is set up each time you run the 
> Python interpreter. You need to look at the suggestions you've had for 
> setting the PYTHONPATH environment variable to effect changes to all 
> future Python execution.

Or, often better and cleaner, use .pth files as described in the 
documentation for the standard library "site" module.


More information about the Python-list mailing list