Why do I only have pip3 but no pip?
Solution 1:
If you had python 2.x and then installed python3, your pip will be pointing to pip3. you can verify that by typing pip --version which would be the same as pip3 --version.
On your system, you have now pip, pip2 and pip3.
If you want you can change pip to point to pip2 instead of pip3.
you can either add the alias to your ~/.bashrc
alias pip=pip3
or add to your $PATH symlink named pip pointing to pip3 binary
Solution 2:
MacOS comes with python version 2.7.10. This version does not include pip
.
If you download and install python3 from python.org, then you will get pip3
as the command to install python modules for python3.
If you download an updated version of python 2.7 from python.org, that will come with pip
. At which point, pip
will install stuff for python2, and pip3
will install stuff for python3. The two installations are entirely separate.
As jmh points out, if you just want to add pip
to the existing OS-bundled python 2.7, then there's an easy command to do that.
sudo easy_install pip
Solution 3:
You can try the following command on the terminal: sudo easy_install pip
.
Solution 4:
You can install pip after installing pip3 on mac by using pip3 install --upgrade pip
. pip3 works fine but in some cases, like when installing jupyter pip is better.
Solution 5:
macOS 10.14.6 preinstalled python 2.7.10, but it doesn't come with pip. It does have pip3 for python3.
bash-3.2$ python --version
Python 2.7.10
bash-3.2$ which pip
bash-3.2$ which pip2
bash-3.2$
I just want pip to be pip3 BUT not with alias because on other mac I found they are not alias.
~ ➤ which pip
/usr/local/bin/pip
~ ➤ which pip3
/usr/local/bin/pip3
~ ➤ ls -al /usr/local/bin/pip
-rwxr-xr-x 1 qiulang admin 235 Oct 8 17:58 /usr/local/bin/pip
~ ➤ ls -al /usr/local/bin/pip3
lrwxr-xr-x 1 qiulang admin 33 Oct 8 17:53 /usr/local/bin/pip3 -> ../Cellar/python/3.7.2_1/bin/pip3
~ ➤ pip --version
pip 19.2.3 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
~ ➤ pip3 --version
pip 19.2.3 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
This SO helps as well https://stackoverflow.com/questions/17271319/how-do-i-install-pip-on-macos-or-os-x
I finally find the easy way to let pip to be pip3 is just update it
lang@localhost % sudo pip3 install --upgrade pip
But then the preinstalled pip3 will be "obsolete":
lang@localhost % pip3 -V
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
pip 20.2.4 from /Library/Python/3.8/site-packages/pip (python 3.8)
lang@localhost % pip -V
pip 20.2.4 from /Library/Python/3.8/site-packages/pip (python 3.8)
This article https://techwithtech.com/python-pip-vs-pip3/ is quite good in explaining pip overall