sys.path ordering question

Mark Hammond mhammond at
Thu Dec 20 07:22:12 CET 2001

David Bolen wrote:

> Mark Hammond <mhammond at> writes:
>>Use a .pth file like these packages do.  This is really what the Win32 
>>extensions should do too.
> But I thought one problem with .pth files is that they wouldn't work
> if Python was invoked from a COM object (and couldn't locate the
> executable location, and thus the .pth files), which would certainly
> affect the Win32 extensions.  Or since that's been cleaned up in
> Python 2.2 (I think), is this a 2.2+ suggestion?

This has been fixed in 2.2.  In some embedding situations, sys.prefix 
was not set correctly, and hence Python could not locate the .pth files. 
   Python 2.2 correctly identifies it's home in all (reasonable) scenarios)

So yeah, this is a 2.2+ suggestion - the installer could simply change 
the way it registers these path entries based on the version it is built 

I also believe the COM work could benefit from some other 2.2 work, 
particularly the way COM properties work - this is something I will 
delve into over the next few months.


More information about the Python-list mailing list