Redundant elements in sys.path

Steve Holden sholden at bellatlantic.net
Tue Feb 8 10:06:01 EST 2000


I noticed that both PythonWin and Idle have the same items, although
with different case representations, in sys.path.  Since the filestore
isn't case-sensitive on Windows NT I'm wondering

	a) How these duplicates came about (multiple installs?), and
	b) What I can do to get rid of them (registry scoured, but
		nothing probable found).

The code I used to detect this situation is no great shakes:

>>> s=list(sys.path)
>>> s.sort()
>>> for p in s:
...	print p

Output from PythonWin:

C:\Program Files\Python
C:\Program Files\Python\DLLs
C:\Program Files\Python\DLLs
C:\Program Files\Python\Lib
C:\Program Files\Python\Lib\lib-tk
C:\Program Files\Python\Lib\plat-win
C:\Program Files\Python\Pythonwin
C:\Program Files\Python\Pythonwin
C:\Program Files\Python\lib
C:\Program Files\Python\lib\lib-tk
C:\Program Files\Python\lib\plat-win
C:\Program Files\Python\win32
C:\Program Files\Python\win32\lib

Output from Idle:

C:\PROGRA~1\PYTHON
C:\PROGRA~1\Python\Tools\idle
C:\Program Files\Python
C:\Program Files\Python
C:\Program Files\Python\DLLs
C:\Program Files\Python\DLLs
C:\Program Files\Python\Lib
C:\Program Files\Python\Lib\lib-tk
C:\Program Files\Python\Lib\plat-win
C:\Program Files\Python\Pythonwin
C:\Program Files\Python\lib
C:\Program Files\Python\lib\lib-tk
C:\Program Files\Python\lib\plat-win
C:\Program Files\Python\win32
C:\Program Files\Python\win32\lib

Since I'm not running from source distribution I'd appreciate it
if someone could explain how PYTHONPATH is initialized and how I
can simplify my environment to remove this duplication.

regards
Steve Holden
--
"If computing ever stops being fun, I'll stop doing it"



More information about the Python-list mailing list