<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 13 July 2013 10:05, Paul Moore <span dir="ltr"><<a href="mailto:p.f.moore@gmail.com" target="_blank">p.f.moore@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How robust is the process of upgrading pip using itself? Specifically on Windows, where these things typically seem less reliable.</blockquote></div><br>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 it.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">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 :-(</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">On the other hand, "python -m pip install -U pip" works fine because it avoids the exe wrappers.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
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.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Does anyone have any suggestions?</div><div class="gmail_extra"><br></div><div class="gmail_extra">Paul.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
PS In better news, apart from this issue, pip upgrades of pip and setuptools seem fine.</div></div>