How To Install Pip3?

The pip3 is the official Python package manager in order to install 3rd party modules. Python provides a lot of modules and libraries by default but as a popular programming language, there are also a lot of 3rd party modules and libraries. The pip3 is created to manage these modules or libraries by searching, installing, updating, removing them. The pip3 command can be used with Python installation which can be Windows, Ubuntu, Debian even MacOSX. In this tutorial, we examine how to install pip3 for different operating systems and platforms.

Check If pip3 Installed

The pip3 may be installed previously for the current operating system and we may do not need to install it again. We can check the pip3 if it is installed previously by using it with the -v option which is used to show the pip3 command version. If the pip3 is installed already the version information of the pip3 command will be shown like below.

$ pip3 -V
pip 20.3.4 from /usr/lib/python3/dist-packages/pip (python 3.9)

If the pip3 is not installed on a Debian, Ubuntu, or Mint system the following error message is displayed.

Command 'pip3' not found, but can be installed with:

If the pip3 is not installed on a Windows operating system the error message will be like below.

'pip3' is not recognized as an internal or external command, operable program or batch file.

Install pip3 for Ubuntu, Debian, and Mint

Debian, Ubuntu, and Mint use the package base the pip3 can be installed on all of them with the following apt install command. The pip3 package is named as python3-pip .

$ sudo apt install python3-pip
Install pip3 for Ubuntu, Debian, and Mint

Install pip3 for Windows

By default recent Python installer versions install the pip3 command. But if it is not installed first the get-pip.py file should be downloaded via the pypa.io web site via the browser or using a command-line download tool like curl .

https://bootstrap.pypa.io/get-pip.py

> curl https://bootstrap.pypa.io/get-pip.py

Then the downloaded get-pip.py file should be executed with the python3 interpreter like below.

> python3 get-pip.py

After the installation is complete it can be checked with the -V or --version options.

> pip -V

Install pip3 for MacOSX

The pip3 command can be installed for MacOSX operating systems by using the brew package management tool. The brew install command is used like below.

$ brew install pip3

Alternatively, the Windows method can be used which is described above. The get-pip.py file is downloaded like below.

https://bootstrap.pypa.io/get-pip.py

And then it should be executed with the python3 interpreter like below.

$ python3 get-pip.py

Search Python Packages with pip3

The pip3 command can be used to search 3rd party packages for Python3. The search term is used to search and list specified term-related packages.

$ pip3 search django

Install Python Packages with pip3

3rd party Python3 packages can be installed by using the pip3 install command like below.

$ pip3 install django

Remove Python Packages with pip3

Existing or already installed 3rd party Python packages or modules can be removed or uninstalled with the pip3 remove command like below.

$ pip3 remove django

Leave a Comment