Where is sys.path set?

Pierre Rouleau prouleau001 at sympatico.ca
Sat Aug 23 23:00:02 CEST 2003


I can't remember where/how sys.path is set (aside from the automatically 
loaded site.py) and i get a strange entry in it.  Can anyone remind me 
where/how to control sys.path on a Win32 machine (i'm running XP on the 
one where the issue arises).

I can't figure out why the 'C:\WINDOWS\System32\python23.zip' entry is 
inside sys.path.  That file/dir does not exist on the disk.  Could a 
failing (crashing) Pythonwin installation caused that?

Here is what I have:


[Shell buffer started: python]
Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import sys
 >>> for n in sys.path:
...   print n
...

C:\dev\python
C:\WINDOWS\System32\python23.zip
C:\Python23\lib\site-packages\Pythonwin
C:\Python23\lib\site-packages\win32
C:\Python23\lib\site-packages\win32\lib
C:\Python23\lib\site-packages
c:\python23\DLLs
c:\python23\lib
c:\python23\lib\plat-win
c:\python23\lib\lib-tk
c:\python23
c:\python23\lib\site-packages\Numeric
 >>>

Thanks

/Pierre





More information about the Python-list mailing list