pip3 is the Python 3 package manager in order to search, install, update or remove 3rd party Python packages. There are different versions of the
pip package manager related to the Python version. Python2 uses the pip2 in order to search, install, update or remove 3rd party Python packages.
Upgrade pip Using Python3
The pip3 is a Python module that can be also managed or upgraded using the
python3 command. The python3 command with the
-m option to specify pip module and use the
--upgrade options like below.
$ python3 -m pip install --upgrade pip
The pip3 command is created to upgrade 3rd party Python modules but it can also upgrade itself without a problem. The pip3 command is used to upgrade itself like below where the
install parameter is specified with the
--upgrade option. Also, the “pip3” is provided as the package we want to upgrade. Keep in mind that pip3 is also a Python package or module like others.
$ sudo pip3 install --upgrade pip3
pip is an alias to the active version of the Python pip. If the Python3 is installed only the pip command refers to the pip3 as well. The pip can be upgraded like below which will actually upgrade the “pip3” under the hood.
$ sudo pip install --upgrade pip3
Upgrade pip3 For Current Users
The pip3 can be also upgraded for the current user only. The
--user option is provided to the pip3 command in order to upgrade pip3 for the current user and not other users. This can be useful if you do not have permission to change system-wide Python packages.
$ sudo pip3 install --user --upgrade pip3
Check Upgraded pip3 Version
After upgrading the pip3 command we can check the recent pip3 version by using the
$ pip3 --version
pip 22.0.4 from /home/ismail/.local/lib/python3.9/site-packages/pip (python 3.9)