[Distutils] eggs end up at end of sys.path

Phillip J. Eby pje at telecommunity.com
Tue Nov 8 22:11:31 CET 2005

At 03:10 PM 11/8/2005 -0500, David Handy wrote:
>I have been lurking on this list for a while. The two features that
>convinced me it was time to start using setuptools were automatic generation
>of .exe starter programs from console_scripts entry points, and this
>Activated distributions are now inserted in sys.path (and the working set)
>just before the directory that contains them, instead of at the end. This
>allows e.g. eggs in site-packages to override unmanaged modules in the same
>location, and allows eggs found earlier on sys.path to override ones found
>However, after I do a pkg_resources.require(), my egg always ends up at the
>end of sys.path. I exected the egg file to show up before the directory that
>contained it, in this case a non-site-packages directory in my PYTHONPATH.
>This is on setuptools versions 0.6a7 and 0.6a8dev-r41402.

Could you provide me with your steps to reproduce, so I can try to find out 
what's wrong?

One possibly important thing: the code that finds what sys.path entry 
contains the egg is currently case-sensitive and separator-sensitive.  It's 
possible that if your PYTHONPATH uses lowercase and slash separators and 
the egg is the other way around, or vice versa, the container checking may 
be failing.  You can verify this by printing sys.path after the require() 
and see if the paths are the same.

More information about the Distutils-SIG mailing list