Need Help Re:PATH

Snoopy :-)) genius at idirect.com
Sat Mar 18 21:51:42 CET 2000


Thanks forr the help Randall.  I noticed your resposnse in the Python NG as well.
I followed your suggestion and am responding below with the results.
Randall Hopper wrote:

> Snoopy :-)):
>  |PATH & PYTHONPATH.  I just don't know what am I doing wrong.
>  |
>  |For the purpuse of Practice In my home directory I created a directory
>  |called"Pydir" where I wan to keep the "Module & Script " Files.  I want
>  |to use the "Bash-Shell".  So In my (Home) "bash_profile " I did the
>  |following configuration:
>  |PATH=$PATH:/HOME/bin:/usr/bin/python:.:/home/charly/Pydir
>  |PYTHONPATH=$PYTHONPATH:.:/home/charly/Pydir:/usr/lib/python1.5:/usr/lib/python1.5/lib-tk
> ...
>
> I believe you need to put an "export" before your declarations for bash.
> Also, when you say "bash_profile", the user file for this is $HOME/.bashrc
>
> Try this:
>
>     cd $HOME
>       echo $PYTHONPATH                        <-- Make sure /home/charly/Pydir

>                                            shows up here

    I did the above but  it returns me to the "Prompt".  Nothing else shows.

>
>     export PYTHONPATH=/home/charly/Pydir    <-- If not, just do this
>     python
>     >>> import mymodule

I did the above and it seem to work.  However it is only effective while I am logged in.  If
I loggout and log back again I have to use the above in order for things to work.  This is
confirmed by one of the Linux Books which states that this is a temporaary solution.  The
book say that in order to make it permanent  the
"PYTHONPATH=$PYTHONPATH:.:/home/charly/Pydir "  should be placed in the
"/home/charly/.bash_profile"  file.

I've done this as well but for some reason it's not taking efect.  To make sure  I also
logged out and restarted.   If I don't do the above "export PYTHONPATH..etc...."  Then I have
to run python from the file's current directory (Pydir) in order to be able to "import" the
file.

I am either doing something wrong in the configuration or there is a Bug somewhere.  I've
been browsing myt books as well as the Tutorials or the past 2-weeks and can't find the
answer.  Purhaps if I bug people in these groups  long enough,some one will  help me see the
light.  I sure would appreciate it.
Best regards
Charles


>
>
> --
> Randall Hopper
> aa8vb at yahoo.com





More information about the Python-list mailing list