PYTHONPATH vs PATH?

Michael Yanowitz m.yanowitz at kearfott.com
Mon May 8 09:44:50 EDT 2006


Hello:

   Someone on my team tried out installing my Python code and
found that setting PYTHONPATH does not work, but setting PATH
environment variable works the way PYTHONPATH should. Is that
how it supposed to be, or is that a bug or feature?

-----Original Message-----  (parts deleted)
Subject: question on Python for windows

I ran into trouble getting our software to work with the debuggers
based on the user guide (updated after the CDROM).

PYTHONPATH=.;..;DIRECTORY-CONTAINING-scenarios.py
    Where DIRECTORY-CONTAINING-PYTHON-SCRIPTS.py is the directory containing
the Python scripts .

this actually is the PATH, not PYTHONPATH, and is correct if you
installed the Python scripts to the Python scripts folder, and then start
up from the Python scripts folder, which I would say is normally not
going to be the case.

I installed our software to C:\sp

I installed Python to E:\Python24 (the default is the same folder on C
drive, I just changed the drive letter)

when I installed the additional 3 packages they knew where Python was
already and all I did was pick the default choices.

but, the trouble was that the PYTHONPATH using . and .. does not find
the Python scripts folder if you are in C:\sp

I used this to make it work (based on Python in E:\Python24 and in C:\sp)

set PATH=%PATH%;E:\Python24;E:\Python24\Scripts

now I start in my C:\sp folder (where the config.txt file is) and
everything works fine

I did try just setting PYTHONPATH but it is actually PATH that matters.
  If you don't include the Python base and Scripts folders in the PATH
it does not work.  I verified that not setting PYTHONPATH but just set
PATH to include the Python base and scripts folders does work.



Thanks in advance:




More information about the Python-list mailing list