[tutor] PATH vs PYTHONPATH on win98 and win2000?

D-Man dsh8290@rit.edu
Tue, 12 Jun 2001 22:02:30 -0400


On Tue, Jun 12, 2001 at 06:28:22PM -0700, Israel Evans wrote:
| 
| I have two problems here.
| 
| The first is that I use windows 2000 at work( ok make that three problems )
| and when I set a PYTHONPATH, things get screwy and tools like IDLE don't
| start up.  I can still run some programs, but not all.  If I delete
| PYTHONPATH everything works great, however setting PATH to accept the few
| exterior python directories that I've created doesn't seem to do anything
| and modules can't be found when I import them.

PYTHONPATH is analogous to CLASSPATH in Java.  It is an environment
variable that contains a path list of root directories for python
modules/packages.  I don't know why IDLE would get weird, unless maybe
you left out something it needs.

PATH is a shell variable that contains a path list to search for
executables in.  If you go to the shell prompt (C:\>) and type
'python', the shell will search through PATH until it finds
python.exe.  Same goes if you type 'foobar', though most likely you
don't have 'foobar.exe' in PATH so it complains that it can't find it.

| The, now third problem is that I use windows98 at home ( four....  four
| problems!)..  and I must ask you how in the bloody blue blazes does one set
| the environment variables in the config.sys or autoexec.bat/tsh thingamabobs
| anyway?

Use a text editor (notepad will suffice though I prefer vim) and add
the lines


set PATH C:\python21;%PATH%
set PYTHONPATH C:\python21\Lib;C:\your_python_modules


to the bottom :-).

-D