In Python, tools for web frameworks (Flask, Django), data analysis (NumPy, Pandas), or machine learning (TensorFlow, scikit-learn) are provided through external packages. Pip is the tool that automates the process of downloading and integrating these packages into your Python environment.
Debian-based Linux systems provide an enterprise-grade foundation for Python and Pip by combining stable dependency management, secure package isolation, ABI-compatible library integration, and reproducible virtual environments.
2 Ways to Install Pip on Debian
Pip features include automated dependency resolution, version management, virtual environment integration, package caching, configuration customization, and secure installation from PyPI or custom repositories. This guide will discuss two ways to install it on Debian, along with some of its basic commands:
1: Through Debian Default Package Installer
The first method to install pip is using the apt package installer, and for that, execute the following command:
sudo apt install python3-pip
Next, verify the pip installation by checking its version by executing:
pip3 --version2: Through Python Script File
Another way to install pip is by using its Python script, and for that, first download it by executing the command below:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
Next, install the virtual environment for pip to avoid the error of the externally managed environment, as it may overwrite packages that the OS or apt needs. So, to install a Python virtual environment, execute:
sudo apt install python3-venv
Next, create the virtual environment and afterwards activate it by using the commands below:
python3 -m venv envforpip
source envforpip/bin/activate
Now install pip on Debian via Python script file by executing:
python3 get-pip.py
Next, verify the installation by checking the version:
pip3 --version
Alternatively, to install Pip on Debian without creating a virtual environment, execute the command below, as it overrides the protection that prevents Pip from writing to/usr/lib/python3.x/site-packages. However, it can break system dependencies, for example, like upgrade requests, urllib3, or cryptography via pip, system tools like apt or software-properties might stop working:
sudo python3 get-pip.py --break-system-packagesBasic Commands for Pip Package Installer
To get started with the pip package installer, here are some of the beginner-level commands along with their description in the following table:
| Command | Purpose / Description |
|---|---|
| pip install [package-name] | Installs a package from the Python Package Index (PyPI). |
| pip install [package-name]==[version] | Installs a package version that is specified |
| pip install –upgrade [package-name] | Updates the specified package to the latest or more recent version available. |
| pip uninstall [package-name] | Uninstalls a package. |
| pip show [package-name] | Displays detailed information about an installed package. |
| pip list | Provides a list of all the installed packages via pip. |
| pip list –outdated | Shows all packages that have newer versions available. |
| pip freeze | Outputs installed packages in requirements.txt format. |
| pip install -r requirements.txt | Installs packages listed in a requirements.txt file. |
| pip check | Checks for broken dependencies among installed packages. |
| pip cache dir | Shows the location of pip’s cache directory. |
| pip cache list | Lists packages currently cached. |
| pip cache purge | Clears up all pip cache data. |
| pip show –files [package-name] | Shows all the installed files for the given package. |
| pip config list | Lists all pip configuration settings. |
| pip config get <key> | Gets the value of a pip configuration setting. |
| pip config set <key> <value> | Sets a pip configuration option. |
| pip install –user [package-name] | Installs the package for the current user only. |
| pip install –upgrade pip | Upgrades pip itself to the latest version. |
| pip install . | Installs a local package from the current directory. |
| pip install –no-cache-dir [package-name] | Installs a package without using the cache. |
| pip debug | Displays comprehensive debug data. |
| pip help | Shows general or command-specific help. |
| python -m pip install [Package-file -name] | To install a package from its distribution file. |
| pip install –break-system-packages [package-name] | installs packages even if it may overwrite system packages. |
Conclusion
Pip is a package management system for Python, used to install, update, and manage third-party libraries and dependencies that are not part of Python’s standard library. This guide discussed two ways to install pip on Debian, which include: using the apt package installer and its Python script, along with some of the basic commands for using pip.

