Debian

How to Install pip3 & pip2 on Debian 11 Bullseye

Pip is a package management tool for Linux-based systems including Debian that allows users to install and manage python-dependent packages on the system. There are two versions of Pip you can install on a Debian-based system; pip3 and pip2. The pip3 is the latest version of pip that requires a Python 3 module, while pip2 is an older version that is used for Python 2.

This guide will cover the installation of pip3 and pip2 on Debian.

How to Install pip3 & pip2 on Debian 11 Bullseye

Before installing pip3 and pip2 on Debian, don’t forget to run the update and upgrade command to upgrade the Debian repository list:

sudo apt update && sudo apt upgrade -y

After that make sure, python3 is installed on Debian system and for that, run the following command:

python3 -V

To run older version of pip you need to have python2 installed on your Debian system. Install python2 on Debian using:

sudo apt install python

Or:

sudo apt install python2

Install pip3 on Debian 11

Next, install the pip3 on Debian with its all dependencies by executing the following command:

sudo apt install python3-venv python3-pip

Then you can upgrade the installed pip3 version through the following command:

sudo -H pip3 install --upgrade pip

Verify the installation of pip3 on Debian by running the version command in the terminal:

pip3 --version

Install pip2 on Debian 11

You can install pip2 on Debian by executing the following command:

wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
python2 get-pip.py

Once installed, verify the installation via the following command:

python2 -m pip --version

How to Use pip on Debian 11 Bullseye

To install any package on Debian with pip3, follow the below-given syntax:

pip3 install <package_name>

In my case, I am installing django package using pip3 from the following command:

pip3 install django

To install the same django package from pip2, run the following command:

pip install django

Bottom Line

Installing pip3 and pip2 on Debian is a straightforward process and it can be done once you install python3 and python2 on the system. After that, you can use python3-pip and wget commands to install Pip3 and Pip2, respectively on Debian. Once the installation is successful you can use pip3 install or pip2 install commands with the package name to install a python package on Debian.

About the author

Zainab Rehman

I'm an author by profession. My interest in the internet world motivates me to write for Linux Hint and I'm here to share my knowledge with others.