[Distutils] "pip uninstall" and pip's lack of support for installing eggs

Carl Meyer carl at oddbird.net
Fri Nov 15 22:37:15 CET 2013

On 11/15/2013 02:16 PM, Marcus Smith wrote:
> Under the covers, pip uses "setup.py install --record" (which requires
> also using --single-version-externally-managed) in order to create an
> install log, that get's used for uninstalls. 
> And due to using `--single-version-externally-managed`, the install is
> done "old-style",  i.e., not installed as an egg, and not knowing how to
> install *from* an egg.  the one caveat being that setuptools (not pip)
> does throw in an .egg-info directory with the project metadata.
> So is "pip uninstall" the primary historical reason for  the lack of egg
> install support? or is there more to the story?

No, "pip uninstall" was a relatively late addition to pip; pip's choices
around installation and distribution formats long predate the addition
of the uninstall feature.

Actually if uninstall had been the primary motivating factor, pip
probably would install egg-style, as one of egg's benefits is that it
makes file-removal trivial (everything's in one zipfile/directory).

Ian Bicking is the only one who can really answer "original motivation"
questions about pip, but my understanding is that lack of support for
installing from eggs was intentional because binary eggs were kind of
broken for the platforms Ian cared about (for the same reasons
platform-specific wheels are still troublesome today on Linux/OSX).

And the flat installation style (--single-version-externally-managed)
was again, as far as I know, simply due to a preference for having a
single site-packages directory rather than the pth file stuff that
setuptools does to make eggs importable.

(For one thing, for a long time setuptools' pth stuff sort of broke
virtualenv; because setuptools forces installed eggs to the top of
sys.path, it meant that you couldn't override something installed as an
egg globally with something installed as a non-egg inside a virtualenv.
I fixed that a long time ago with an explicit workaround in virtualenv.)


More information about the Distutils-SIG mailing list