0

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 1

1

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
Sign up to request clarification or add additional context in comments.

2 Comments

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?
@user3693009 Yes. You should be able to install pip using the get-pip.py bootstrap script. See my updated answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.