[Distutils] Executable wrappers and upgrading pip (Was: Current status of PEP 439 (pip boostrapping))

Paul Moore p.f.moore at gmail.com
Sun Jul 14 15:29:22 CEST 2013

On 13 July 2013 10:05, Paul Moore <p.f.moore at gmail.com> wrote:

> How robust is the process of upgrading pip using itself? Specifically on
> Windows, where these things typically seem less reliable.

OK, I just did some tests. On Windows, "pip install -U pip" FAILS. The
reason for the failure is simple enough to explain - the pip.exe wrapper is
held open by the OS while it's in use, so that the upgrade cannot replace

The result is a failed upgrade and a partially installed new version of
pip. In practice, the exe stubs are probably added fairly late in the
install (at least when installing from sdist, with a wheel that depends on
the order of the files in the wheel), so it's probably only a little bit
broken, but "a little bit broken" is still broken :-(

On the other hand, "python -m pip install -U pip" works fine because it
avoids the exe wrappers.

There's a lot of scope for user confusion and frustration in all this. For
standalone pip I've tended to recommend "don't do that" - manually
uninstall and reinstall pip, or recreate your virtualenv. It's not nice,
but it's effective. That sort of advice isn't going to be realistic for a
pip bundled with CPython.

Does anyone have any suggestions?


PS In better news, apart from this issue, pip upgrades of pip and
setuptools seem fine.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20130714/27e0164a/attachment.html>

More information about the Distutils-SIG mailing list