usage of .pth files

swapnil swapnil.st at gmail.com
Wed Jan 13 03:01:41 EST 2010


Python's documentation (http://docs.python.org/install/
index.html#modifying-python-s-search-path) states that we can add more
locations to python's module search path by
"add a path configuration file to a directory that’s already on
Python’s path, usually to the .../site-packages/ directory"

sys.path for my Python installation show the following
>>> sys.path
['', 'C:\\WINNT\\system32\\python26.zip', 'c:\\python26\\DLLs', 'c:\
\python26\\lib', 'c:\\python26\\lib\\plat-win', 'c:\\python26\\lib\
\lib-tk', 'c:\\python26', 'c:\\python26\\lib\\site-packages']

I tried appending certain location by putting a .pth file in all of
the above locations, but it gets appended only when the .pth file is
present in 'c:\\python26\\lib\\site-packages' or 'c:\\python26', but
according to the documentation it should work for all of the above
locations. Any ideas??

I'm running Python 2.6.4 on WinXP



More information about the Python-list mailing list