How to Install Pip on Debian 9

Install Pip on Debian 9

In this article, we will have explained the necessary steps to install and configure Pip on Debian 9. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Pip is a package management system which you can use to install and manage packages written in Python. Python is a programming language that allows you to perform web development, software development, system administration, scientific and numeric data analysis and much more. The Python Package Index (PyPI) hosts thousands of third-party modules for Python and you can install any of these modules using the pip package manager.

Install Pip on Debian 9

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

sudo apt update
sudo apt upgrade

Step 2. Install PIP on Debian.

  • Install PIP for Python 3.

Install pip for Python 3 and all of its dependencies by typing:

sudo apt install python3-pip

Verify the installation by printing the pip version:

pip3 --version
  • Install PIP for Python 2.

Install pip for Python 2 and all of its dependencies:

sudo apt install python-pip

Check version and confirm installation by entering following:

pip --version

Step 3. Basic usage of PIP.

  • Basic usage of PIP for python 3

To list all the commands in PIP enter following

pip3 --help

Get information of specific command enter following

pip3 install --help

To search package with PIP enter following

pip3 search PACKAGE_NAME

Install package with PIP enter following in terminal

pip3 install PACKAGE_NAME

To install package from requirements file

pip3 install -r requirements.txt

Upgrade package with PIP

pip3 install --upgrade PACKAGE_NAME

Uninstall package with PIP

pip3 uninstall PACKAGE_NAME
  • Basic usage of PIP for python 2

To list all the commands in PIP enter following

pip --help

Get information of specific command enter following

pip install --help

To search package with PIP enter following

pip search PACKAGE_NAME

Install package with PIP enter following in terminal

pip install PACKAGE_NAME

To install package from requirements file

pip install -r requirements.txt

Upgrade package with PIP

pip install --upgrade PACKAGE_NAME

Uninstall package with PIP

pip uninstall PACKAGE_NAME

Congratulation, you have learned how to install and configure Pip on Debian 9 Stretch. If you have any question, please leave a comment below.