Debian

Install Python PIP Debian 10

PIP is a command-line package manager of python that allows you to manage and install new python-based software packages.  Using this tool allows users to search for packages from the python packages index as well as install its dependencies. Python pip-tools are not readily installed on most Linux operating systems. However, you can manually install the python-pip utility on your Debian and other Linux distributions.

Today, we will show how you can install python-pip packages on the Debian 10 system through the command-line application. All commands of this article have been implemented on the Debian 10 buster environment. Almost all these steps can also be used on Ubuntu and Linux Mint operating environments.

Pip Installation on Debian 10 system

Python has two different versions, python2 and 3. However, you need to separately install python pip-tools for both python versions. Open the terminal from the application menu and then start the installation of a python-pip using the following method:

Install pip for python2

The following steps are included while you install the pip tool for python2 on Debian 10:

Step 1: Update system packages 

Run the following command to update the system package list:

$ sudo apt update

Step 2: Install Pip

First, ensure the installation of python2 on your system by running the following command:

$ python2 -V

The installed version will be displayed on the terminal. Now, type the following command to install the pip tool for Python2:

$ sudo apt install python-pip

The above command will automatically install pip with all its dependencies on your system.

Step 3: Check pip version

Once all packages are installed, issue the following command to check the installed version of the pip tool for python2:

$ pip –version

The installed version will be displayed on the terminal after running the above command.

Install Pip for python 3

Similarly, the following command you need to implement on the terminal to install pip-tools for python 3 is shown below:

Step 1: Update the Packages list by running the following command:

$ sudo apt update

Step 2: Install pip along with all dependencies for python 3 by executing the following command:

$ python3 –V

$ sudo apt install python3-pip

Step 3: verify the pip installation using the following command:

$ pip3 --version

Use of Pip 

We will also explore the use of pip in this article. By using pip, the user can install python packages from PyPI, local projects, version control, and other project distributions. Usually, the pip would be used inside the virtual environment. Python virtual environment allows you to install python packages inside an isolated space without disturbing the other python project modules.

Let’s discuss some useful pip commands that are mentioned below.

With pip, you can list all packages, as follows:

$ pip list

You can search for a package through pip, using the following command:

$ pip3 search “package-name”

With pip, you can install a python package from PyPI, as follows:

$ pip3 install package-name

For example, we want to install a python package ‘scrapy’ through pip. So, the following command is what you need to enter on the terminal:

$ pip3 install scrapy

You can also display the package information using the following commands:

$ pip3 show package-name
$ pip3 show wheel

The command below allows you to remove or uninstall a package through pip3:

$ pip3 uninstall package-name

To uninstall the scrapy package, run the below-mentioned command:

$ pip3 uninstall scrapy

That’s all about the basic commands of the pip tool. To explore more commands and options about pip, run the following command on the terminal:

$ pip3 –help

All pip commands and option will be displayed on the terminal as follows:

Conclusion

In this article, we have learned how to install the python-pip tool for python 2 and python 3 on the Debian 10 buster system. We have executed various commands to understand the use of pip. Moreover, we have also explained the use of the pip tool.

About the author

Karim Buzdar

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.