[Distutils] Installing namespace packages with pip inserts strange modules into sys.modules

PJ Eby pje at telecommunity.com
Sun Sep 14 18:52:07 CEST 2014


On Fri, Sep 12, 2014 at 3:55 PM, Erik Bray <erik.m.bray at gmail.com> wrote:
> Unfortunately there are some dark corners of setuptools I've
> encountered where namespace packages don't work properly during
> installation *unless* they were installed in the old-fashioned
> setuptools way.  I'll have to see if I can dig up what those cases
> are, because they should be fixed.

I don't know if this is what you had in mind, but, the main problem I
know of with changing setuptools to not install the .pth files, is
that if you already have any __init__.py's installed (and possibly,
any namespace .pth files to go with them), then the newly-installed
package isn't going to work.  PEP 420 only takes effect if there are
no existing __init__.py files for the namespace.

In other words, it's not just a matter of changing how things are
installed, it's also a matter of upgrading existing environments with
things installed by older installation tools.


More information about the Distutils-SIG mailing list