Newbie problem with PYTHONPATH

Gordon McMillan gmcm at hypernet.com
Wed Sep 8 13:50:07 EDT 1999


Brent Goodwin writes:
> 
> I'm having problems getting Python to recognize a path to a drive
> other than the one it is installed on.  I have tried setting the
> PYTHONPATH in the autoexec.bat (I'm on a Win95 machine) to no avail,
> and I tried using the path editor in the Pythonwin GUI.  Neither
> method worked.  The way I've found so far is to make a module which
> appends the path I'm looking for to sys.path, and import the module
> manually each time I start the interpreter.
> 
> I have to believe there is a better way.  Any ideas?

Both PYTONPATH and the registry work for me. Do you get an error? 
What does sys.path look like before and after trying each of these?

You'll see comments around about avoiding directory names with spaces 
in them. I use the regular c:/Program Files/Python installation, but 
you have to be aware that while some MS tools are smart enough to 
handle the space, others are not and will require double quotes 
around the path.


- Gordon




More information about the Python-list mailing list