sys.path ordering question

Mark Hammond mhammond at
Wed Dec 19 06:38:57 EST 2001

Kerim Borchaev wrote:

> Could someone explain the paths ordering logic used to create  sys.path
> listed below?
> Why win32 extensions are before standard python paths but  Numeric and other
> after?
> (I know this ordering makes sense - it's how modules are searched.

Paths before the standard paths come from either the registry or PYTHONPATH.

Then .pth files are used, and their paths *appended*, yielding the 
results you see.

 > And in fact I'm asking this to get guidelines how should I arrange
 > my own packages.)

Use a .pth file like these packages do.  This is really what the Win32 
extensions should do too.


More information about the Python-list mailing list