2

I am using macOS Sierra 10.12 and after I upgraded my OS I can no longer install packages for python 3 using pip. Before I used to use pip for python2 and pip3 for python 3 as I have both versions of Python. But now I can no longer use pip to install libraries for python2.

Can anyone help me how can I change my default pip installer to python2? So that I can just use pip install in order to install for python 2.

For your information - when I only type python on terminal it says my default is python 2.7.

3
  • Yes use pip2 for python2 Commented Sep 25, 2016 at 21:43
  • pip2 command is not working for my mac....how can i enable it? Commented Sep 26, 2016 at 2:35
  • 1
    Try this command python -m pip install <lib> or python3 -m pip install <lib> for python 3 Commented Sep 27, 2016 at 7:55

2 Answers 2

3

on running

which pip

I got /usr/local/bin/pip Which meant it was pointing to pip2

To change default pip to pip3, run

sudo ln -s /usr/local/bin/pip3 /usr/local/bin/pip
Sign up to request clarification or add additional context in comments.

Comments

1

install pip for Python2.7 with easy_install:

sudo easy_install-2.7 pip

now you can use pip for the same specific version of Python:

sudo pip2.7 install BeautifulSoup

Comments

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.