[Tutor] how to permanently add a module path

Alan Gauld alan.gauld at btinternet.com
Sat Dec 23 10:04:43 CET 2006


"Christopher Arndt" <chris.arndt at web.de> wrote 
> Linux:
> 
> Depends on your distribution:

It depends even more on the shell you use.
In csh or tcsh the file to modify is .cshrc

> - Standard way would be to edit ~/.bash_profile and add e.g.

I prefer to modify environment variables in .profile.
That way they are visible in bash, sh, ksh, ash 
which all read .profile, whereas only bash reads .bash_profile.

> # entries are separated by colons ':'
> PYTHONPATH=$HOME/lib/python:/where/my/other/python/modules/live
> export PYTHONPATH

I usually put $PYTHONPATH in front too in case there is a site 
wide version defined already.

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld



More information about the Tutor mailing list