July 10, 2025
Tutorials

How to Install Pip on Debian 12

INSTALL PIP ON DEBIAN 12

Pip is an efficient tool for managing Python package management. If you are a system administrator or a Python developer, you don’t want to miss out on pip3. It provides users with a way to download and manage Python-based packages that are all available from the Python Package Index (PyPI). Since Python 2 has been deprecated. Due to pip importance, this article will explain all possible and current ways of installing pip3 on Debian 12.

Table of Contents

How to Install Pip3 on Debian 12?

To install pip3 on Debian 12, update the package list and install Python3 (pip3) with the command “sudo apt install python3-pip”. And then it sets pip3 on Debian 12. To install pip3 on Debian 12, you have several choices. Let me show you, here are the three ways to install pip3 on Debian 12:

Method 1: Install Pip3 Using the Default Repository

Using the tool Pip3, users can do an all-in compilation of Python interfaces. Let’s install Pip3 from the Debian repository:

Step 1: Update Packages

First, update your package list:

sudo apt update
sudo apt update

Step 2: Install Python3

Users can install the “python3-pip” package in order to install Python3 or pip3. It is because Pip3 is based on Python3:

sudo apt install python3-pip
sudo apt install python3-pip

Step 3: Check Pip3 Installation

Finally, verify that the installation is accomplished through the following command. It makes sure you installed it correctly.

pip3 --version
pip3 --version

Optional: Install Other Packages Using Python 3

Now, make sure you’re working with Python 3 (especially pip3 version 23.0.1) as opposed to Python 2. Then, install Panda through the following command:

sudo apt install python3-pandas
sudo apt install python3-pandas

Uninstall Pip3 on Debian 12

pip3 is the package installer for Python 3, which allows users to manage Python packages or modules. First, remember to back up before you uninstall pip from your system.

sudo apt autoremove python3-pip
sudo apt autoremove python3-pip

You’ll be prompted to confirm the uninstallation.

Method 2: Install Pip3 by Downloading the Python Script

In this method, you can download the script file from the official Python website or other trusted sources. So, let’s install Pip3 through the Python script:

Step 1: Update Package List

First, refresh the repository via the “update” utility:

sudo apt update
sudo apt update

Step 2: Install pip3 and Python Environment

Then install pip3 using the “python3-pip” command. Optionally, for the Python environment (e.g., python 3-venv ), type:

sudo apt install python3-venv python3-pip
sudo apt install python3-venv python3-pip

Step 3: Run the Python Script

Now, you need to visit the official pip website and download the “get-pip.py” script (or you can also type it in yourself): Do a venv and activate it.

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

Then, create a virtual environment and activate it.

python3 -m venv myenv
source myenv/bin/activate
source myenv/bin/activate

Lastly, execute this command to install pip3:

python3 get-pip.py
python3 get-pip.py

Finally, “pip-25.1.1” has been installed.

You may also upgrade an existing pip installation via the –upgrade option in conjunction with the “sudo” privileges command like so:

sudo apt install python3-pip --upgrade
sudo apt install python3-pip --upgrade

Fix the “externally-managed-environment” Error.

If you see the “error: externally-managed-environment” appear under your account, please try this line: sudo rm /usr/lib/python3.11/EXTERNALLY-MANAGED. Then just delete the extra entry that exists after the /; keep only those entries that are in your original PATH.

Step 4: Manage Python Packages

If you can’t find the pip3 command, go back to where we were originally installed. Now it’s time for Python packages using Pip3:

pip3 install flask
pip3 install flask

That’s all there is about the installation of pip3 on Debian 12.

How to Install Python on Debian 12?

Python is a programming language that has many different uses. Let’s install it through the below steps:

Step 1: Update Packages List

Confirm that the packaging list is updated. Run the following script for this purpose:

sudo apt update
sudo apt update

Step 2: Check Python Version

Before you install any package, it is a good practice to check whether or not it is available in the repositories. For instance, utilize the “python3” command along with the “show” tool:

sudo apt show python3
sudo apt show python3

Step 3: Install Python

After finding Python, now install the version by running:

sudo apt install python3
sudo apt install python3

Step 4: Confirm the Installation

Once you have completed the installation process, check to see if your Python has been installed successfully:

python3 --version
python3 --version

Optional: Remove/Uninstall Python

Enter the following command in your terminal to uninstall all Python versions along with their dependencies on Debian 12:

sudo apt purge python3*

Note: Python is used by system utilities to perform various tasks, so naturally it’s advisable not to uninstall it without a good reason.

How to Install a Python Version on Debian 12?

You may use the ”sudo apt show python3” command to list any other Python 3 versions if available in the repository. Here’s what we should do:

Install the Specific/Desired Python Version

You are now installing the specific Python version. For example, install Python 3.11 using:

sudo apt install python3.11
sudo apt install python3.11

To fit your needs, replace 3.11 with the version number that you have available.

Confirm Python

Finally, check the version of Python by using the “version” utility as seen below:

python3.11 --version
python3.11 --version

Optional: Uninstall Specific Version of Python

To remove specific versions of Python on Debian 12, first find the version names you want to remove through the following command:

whereis python3
whereis python3

This command prints out the paths to the different versions of Python that are installed on your system.

Uninstall Python Versions

Uninstall a particular Python version by using the “remove” utility along with the version name:

sudo apt remove python3

Common Problems and Their Solutions

Error 1: “pip: command not found”

Users can check that pip is on their PATH or use the full path where pip is installed:

python3 -m pip --version

Issue 2: Permission denied errors

For user-specific installations: pip install –user package_name

pip install --user package_name

Issue 3: SSL certificate errors

Update certificates:

sudo apt install ca-certificates

Issue 4: Outdated pip version

Upgrade pip:

pip install --upgrade pip

Issue 5: Multiple Python versions conflict

Use a specific Python version:

python3.11 -m pip install package_name

This is all from the article.

Conclusion

Pip is an efficient tool for managing Python package management. In order to install pip3 on Debian 12, update the package list and then install Python3 (which has pip3) via the “sudo apt install python3-pip” command. If you need to verify that Pip3 has been installed properly, use the “pip3 –version” command. This article has described both installing pip3 and python3 on Debian 12 and also getting rid of them.

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video