Discussion Locked

setting the PATH

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Can someone please give me a good explanation to setting up PATHs, CLASSPATHS and give some examples? I am trying to learn how to program using Python 2.1 and my scripts only work in the dir where I intalled but nowhere else. I am using windows 2000 and Linux. Would be great if somebody could explain both.

5 replies

by lo

Hi - Can't help on Linux, still working on learning that, think it can be done.

Kick off a DOS session, enter SET and push ENTER or RETURN. The display shoul have PATH= That is a search list for device and directories to check for a given executable if it isn't found in default directory. Not sure about Win 2000, on Win NT 4 it's Control Pannle, System, Environment tab. The upper section is SYSTEM the lower User (unique to each login I think). Edit the upper and add the device / directory into the existing line. Cautions: if you have spaces in the directory name (like Program Files), put the whole path in quotes "C:\Program Files\..."; be sure to put a semi-colon at the end of the entry unless it is the last entry. I think you can do in the lower section with %path%;. The %PATH% will pull the current value of PATH and add ";" to the end.

If you haven't, do Start, Help, Find tab, PATH, should get some specifics and such there.

You can always specify the path to a file, instead of MYPROGRAM, C:\SOMEDIR\SOMESUBDIR\MYPROGRAM. You can probably use environment variables to specify what/where/etc. Not sure if Python will allow that but environment variables are pretty standard in programming languages.

by bhavyadon

Hi There,
Can't Help in WIn 2000, but for Linux!
You need to edit your startup file for your Shell (.cshrc, .profile .kshrc or .login depending upon your Shell)
Just add the location of the file to the existing line.
I am not sure but PYTHONPATHvariable is also reqd to be set for eacgh usr who will be using PYTHON. This is also generally done in startup files... But again I am not sure about this..
anyway, you can just modify the PATH var in the shell file & try it out if it works..

Bhavya

This discussion is closed to new replies.