How to install Pip 3 or 2 on Debian 11 Bullseye Linux

Pip stands for Pip Installs Python and is a tool for the Python programming language for installing various modules. This is an explicit replacement and an indirect successor to the old easy_install from the Python configuration tools.

In direct comparison, pip’s syntax is based on that of other package administrators, such as APT. Moreover, even with pip, dependencies on other modules are resolved directly, i.e. required additional modules are installed directly. Using it, we can install packages from Python Package Index (PyPI) and other repositories.

It is also possible to load modules directly from version control systems such as Git, Mercurial or Subversion and then install them.

Here we will learn the steps to install pip for Python 2 (pip) and Python 3 (pip3) on Debian 11 Bullseye or 10 using a command terminal.

Installing pip for Python 3 or 2 on Debian 11 or 10

1. Run the system update

Update the system repository to let it know the latest version of the packages available in the base repository.

sudo apt update

2. Install Pip3 for Python 3 on Debian 11 or 10

Although you already have python3 on your, if not install it first.

sudo apt install python3

And to get Pip 3 for Python3 installed, run:

sudo apt install python3-pip

3. Install Pip2 for Python 2

Those who wish to use the Pip 2 on their system can opt for the commands below:

sudo apt install python2

Pip2 cannot be installed directly using the APT Package Manager as it is no longer available in the base repository. Therefore, we have to download and install it manually using its Python package.

sudo apt install curl
curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
sudo python2 get-pip.py

pip2 --version

4. Check the installed versions

To confirm which versions are now available on your system, simply run the version check of installed pythons.

python3.9 --version
python2 --version
pip --version
pip2 --version

5. Let’s install something using pip

You can check out all the packages available for installation via PIP from its official webpage. However, to use it we can use the following syntax:

pip install package-name

For example:

For Python3:

pip3 install "TextStatistic"

For Python2:

pip install "TextStatistic"

Leave Comment

Your email address will not be published. Required fields are marked *