[X-Unix] Set PYTHONPATH

Simon Forster simon-lists at ldml.com
Wed Apr 21 03:34:27 PDT 2004


Xavier

Many thanks. This clears things up a bit. Actually, as I have 
.bash_profile I've added the environment variable there. And now I have 
this path in sys.path.

It's magic.

(Hmm, caffeine levels must be out of kilter).

Simon Forster
_____________________________________________________
  LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK
  Tel: +44 (0)70 9230 5244   Fax: +44 (0)70 9230 5247
_____________________________________________________

On 21 Apr 2004, at 09:01, Xavier Noria wrote:

> On Apr 21, 2004, at 9:46, Simon Forster wrote:
>
>> So, how do I set python's path for my user? And, FWIW, if I "echo 
>> $PYTHONPATH" in the Terminal, I get a blank line. My research 
>> suggests that this is a valid environment variable though. Don't 
>> understand.
>
> These kind of variables (PYTHONPATH, PERL5LIB, CLASSPATH, ...) are 
> normally unset unless someone initializes them.
>
> If your shell is bash, put in ~/.bashrc the line
>
>     export PYTHONPATH=/Users/simonforster/Development/Python/Lib
>
> in zsh that goes in ~/.zshenv. Other shells use other rc files.
>
> Once you've done that there's no need in general to modify sys.path 
> from the very script.
>
> -- fxn
>
> PS: You'll need to source the rc file or open a new Terminal.app to 
> make the initialization effective.



More information about the X-Unix mailing list