[Distutils] Working around .pth/site problems

Paul Moore p.f.moore at gmail.com
Fri Sep 23 12:27:57 CEST 2005

On 9/19/05, Phillip J. Eby <pje at telecommunity.com> wrote:
> In essence, the problem is that Python adds all .pth-specified paths to the
> *end* of sys.path, meaning that system-installed packages in the stdlib or
> site-packages take precedence over anything else you can install, except
> for directories specified in PYTHONPATH or that are in the startup script's
> directory.

I believe that this is a deliberate policy. I seem to recall Guido
saying a long time ago that he doesn't want people to be able to
override the stdlib easily, as it makes "core" python mutable. It's a
long time ago, and I may have misremembered, or indeed Guido may have
changed his mind since. I'd suggest raining this issue on python-dev
as I don't believe that Guido reads distutils-sig.

There may be scope for an "official" solution in 2.5, which can be
supplemented by backward-compatibility hacks for earlier versions.


PS Personally, I don't have any issue with what you propose - I use
Python on Windows only at the moment, so I don't have the type of
problems you describe.

More information about the Distutils-SIG mailing list