pip or pip3 to install packages for Python 3?

I have a Macbook with OS X El Captain. I think that Python 2.7 comes preinstalled on it. However, I installed Python 3.5 too. When I started using Python 3, I read that if I want to install a package, I should type:

    pip3 install some_package

Anyway, now when I use

    pip install some_package

I get some_package installed for Python 3. I mean I can import it and use it without problems. Moreover, when I type just pip3 in Terminal, I got this message about the usage:

    Usage:   
      pip <command> [options]

which is the same message I get when I type just pip.

Does it mean that in previos versions, things were different, and now pip and pip3 can be used interchangeably? If so, and for the sake of argument, how can I install packages for Python 2 instead of Python 3?

Your pip is soft link to the same executable file path with pip3. you can use below commands to check where your pip and pip3 real paths are:

    $ ls -l `which pip`
    $ ls -l `which pip3`

you may also use below commands to know more details:

    $ pip show pip
    $ pip3 show pip

When we installed different version of python, we may do such soft links to

  • set default pip to some version.
  • make different links for different versions.

it is same situation about python, python2, python3

Below for who interested in how it happens in different case:

From: stackoverflow.com/q/40832533

Back to homepage or read more recommendations: