For whatever lame reason, I have a bunch of different versions of python installed. The one I want to use (and what my current $PATH is using) is at /opt/python2.6/bin/python. How do I install 'pip' for this version so when I do a 'pip install package' it goes to the right location?
1 Answer
When you have multiple versions of Python with pip installed, you can launch pip using your Python executable:
$python2.6 -m pip [pip-args]
To install pip for a specific Python version, run get-pip.py (https://bootstrap.pypa.io/get-pip.py) with the respective Python executable:
$python2.6 get-pip.py
2 Comments
darksideofthesun
This is what I get when I do that: /opt/python2.6/bin/python: No module named pip. I'm assuming that's because I don't have a version of pip installed for that version of python, right?
Ferdinand Beyer
@user3693009 Yes. You should be able to install pip using the get-pip.py bootstrap script. See my updated answer.