How is sys.path initialized without a PYTHONPATH?

Chris Tavares christophertavares at earthlink.net
Sun Dec 2 05:22:28 EST 2001


"A. Keyton Weissinger" <keyton at weissinger.org> wrote in message
news:mailman.1007269381.20507.python-list at python.org...
> I am using ActiveState's ActivePython 2.1. I do NOT have a PYTHONPATH
> environment variable set on my machine. When I fire up the interpreter
> shell, and do the following:
>
> >>> import sys
> >>> print sys.path
>
> I get the following:
>
> ['', 'C:\\Python21\\Pythonwin', 'C:\\Python21\\win32',
> 'C:\\Python21\\win32\\Lib', 'C:\\Python21', 'C:\\Python21\\DLLs',
> 'C:\\Python21\\lib', 'C:\\Python21\\lib\\plat-win',
> 'C:\\Python21\\lib\\lib-tk', 'C:\\Python21\\Numeric', 'C:\\Python21\\PPM']
>
> Where is the list being generated since I have no PYTHONPATH variable? Can
I
> configure this somehow to include more places (without having to append()
to
> the sys.path in the interpreter shell)?
>
> Thank you...
>
> Keyton
>

Look in the registry, under
HKEY_LOCAL_MACHINE\Software\Python\PythonCore\2.1\PythonPath.

Each key below this point adds directories to the pythonpath. Just add a new
key with whatever name you want, and set the default value to the semicolon
separated list of directories.

-Chris






More information about the Python-list mailing list