problem with PYTHONPATH on WinXP

D Denholm ddenholm at theworld.com
Sun May 9 15:24:12 EDT 2004


I recently installed Python 2.2 on my WinXP box.

I am having problems figuring out how to create the PYTHONPATH
correctly.

I went to the WinXP SystemProperties > Advanced > Environment
Variables and created a System Variable called PYTHONPATH with the
value:

G:\Python22\lib\site-packages\Pythonwin;
G:\Python22\lib\site-packages\win32;
G:\Python22\lib\site-packages\win32\lib;
G:\Python22\lib\site-packages; G:\Python22\DLLs; G:\Python22\lib;
G:\Python22\lib\lib-tk; G:\Python22;
G:\Python22\lib\site-packages\Numeric; G:\cvslocal;
G:\cvslocal\sim\cmd

But when I run Python from the DOS Command Line, import sys, and then
print the sys.path variable, the path does not contain the last
directory entry:

G:\MySim42>python
Python 2.2.3 (#42, May 30 2003, 18:12:08) [MSC 32 bit (Intel)] on
win32
>>> import sys
>>> sys.path
['', 'G:\\Python22\\lib\\site-packages\\Pythonwin',
'G:\\Python22\\lib\\site-pac
kages\\win32', 'G:\\Python22\\lib\\site-packages\\win32\\lib',
'G:\\Python22\\li
b\\site-packages', 'G:\\Python22\\DLLs', 'G:\\Python22\\lib',
'G:\\Python22\\lib
\\lib-tk', 'G:\\Python22',
'G:\\Python22\\lib\\site-packages\\Numeric', 'G:\\cvs
local']
>>>

Note that the sys.path contents are the same (taking into account the
differing syntax) as the PYTHONPATH value EXCEPT for the last
directory: "G:\cvslocal\sim\cmd"

I have tried several times but the last entry never shows up... Also,
I have tried deleting the PYTHONPATH enviroment variable completely
but the sys.path does not change. Any suggestions or explanations
would be appreciated.

--Doug



More information about the Python-list mailing list