I try to maintain several built and installed versions of Python, currently 2.6, 2.7, 3.2, 3.3, 3.4 and 3.5alpha, all built from the tips of their respective branches in Mercurial. What's the correct/best way to keep pip up-to-date for all those versions? 2.7, 3.4 and 3.5 have ensurepip, but I think that just makes sure you have pip, not that there is a version associated with a specific version of Python, right? Do I just download the latest tarball and run "PY setup.py install" for each version of PY? Thx, Skip
On 7 May 2015 at 13:16, Skip Montanaro <skip.montanaro@gmail.com> wrote:
I try to maintain several built and installed versions of Python, currently 2.6, 2.7, 3.2, 3.3, 3.4 and 3.5alpha, all built from the tips of their respective branches in Mercurial.
What's the correct/best way to keep pip up-to-date for all those versions? 2.7, 3.4 and 3.5 have ensurepip, but I think that just makes sure you have pip, not that there is a version associated with a specific version of Python, right? Do I just download the latest tarball and run "PY setup.py install" for each version of PY?
python -m pip install -U pip will update pip on Windows or *nix, using the current pip. If you don't have a pip at all, then yes, download + python setup.py install in the pip tree. -Rob -- Robert Collins <rbtcollins@hp.com> Distinguished Technologist HP Converged Cloud
On 7 May 2015 at 04:16, Robert Collins <robertc@robertcollins.net> wrote:
If you don't have a pip at all, then yes, download + python setup.py install in the pip tree.
Or use get-pip.py from https://bootstrap.pypa.io/get-pip.py (which will install from wheel, so is probably a tiny bit faster if you care). Paul
Thanks for the responses. I eventually decided to just download and expand the tarball, then execute PY setup.py clean -a PY setup.py install for each of my PYs. I then deleted the pip, pip2 and pip3 items, leaving only the pipXY versions. That avoids any confusion. While it's a bit more work on my part, it achieved the desired result - nothing but a bunch of unambiguous pipXY programs. Skip
Excerpts from Skip Montanaro's message of 2015-05-07 09:58:35 -0500:
Thanks for the responses. I eventually decided to just download and expand the tarball, then execute
PY setup.py clean -a PY setup.py install
for each of my PYs. I then deleted the pip, pip2 and pip3 items, leaving only the pipXY versions. That avoids any confusion. While it's a bit more work on my part, it achieved the desired result - nothing but a bunch of unambiguous pipXY programs.
Skip
Depending on your OS, you might be interested in the ansible role I created for doing this on my dev VMs: http://doughellmann.com/2015/03/07/ansible-roles-for-python-developers.html It's meant for Ubuntu now, but I would be happy to have updates to make it work for other platforms. Doug
participants (4)
-
Doug Hellmann -
Paul Moore -
Robert Collins -
Skip Montanaro