I'm fairly new to Python (v 2.7.3) and having an issue with a duplicate path when I perform a "sys.path" within the interactive interpreter.
>>> import os >>> import sys >>> >>> sys.path '', 'C:\\Python27\\Lib\\idlelib', 'C:\\WINDOWS\\system32', 'C:\\Python27\\Lib\\site-packages\\win32', 'C:\\Python27', 'C:\\windows\\system32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27\\lib\\site-packages', <---- This is the problem, you have duplicates 'C:\\Python27\\lib\\site-packages', <---- This is the problem, you have duplicates
I know that I can hackily and temporarily delete one of the list elements by performing a "sys.path.pop(10)", but that's just a bandaid.
Is there a way to 1) Utilize a function that can traverse the path of where each element of sys.path is finding the list of elements. I need a function that will act as a bloodhound and track these elements' roots down.
2) Permanently delete that duplicate list element.
Lastly, in case you were wondering, here are the contents of my PYTHONPATH variable: "C:\WINDOWS\system32;C:\Python27\Lib\site-packages\win32"
Ideas Are Highly Valued & Appreciated!
This post has been edited by macosxnerd101: 08 January 2013 - 07:43 PM
Reason for edit:: Fixed code tags