adding new paths to sys.path

Peter Harris scav at blueyonder.co.uk
Wed Mar 12 11:12:17 CET 2003


Jon Perez wrote:
> Under Slackware Linux, I've installed Python
> modules in /usr/local/lib/python2.2/site-packages
> instead of /usr/lib/python2.2/site-packages and
> now Python can't find the newer modules.
> 
> In the interactive command line, I can always
> add this new directory to sys.path, however,
> that won't do for scripts run from the command
> line.
> 
> What do I change to get these new package paths
> added to the default paths searched by Python
> when running a script?
> 
> 

In Debian, /usr/lib/python2.2/site.py adds
/usr/local/lib/python2.2/site-packages to sys.path.

In Slack, you have to edit site.py yourself, which is
probably the way you like things if you use Slack...

Peter





More information about the Python-list mailing list