How To Install python-numpy on Debian 9

In this tutorial we learn how to install python-numpy on Debian 9. python-numpy is Numerical Python adds a fast array facility to the Python language

Introduction

In this tutorial we learn how to install python-numpy on Debian 9.

What is python-numpy

python-numpy is:

Numpy contains a powerful N-dimensional array object, sophisticated (broadcasting) functions, tools for integrating C/C++ and Fortran code, and useful linear algebra, Fourier transform, and random number capabilities.

Numpy replaces the python-numeric and python-numarray modules which are now deprecated and shouldn’t be used except to support older software.

There are three methods to install python-numpy on Debian 9. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install python-numpy Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install python-numpy using apt-get by running the following command:

sudo apt-get -y install python-numpy

Install python-numpy Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install python-numpy using apt by running the following command:

sudo apt -y install python-numpy

Install python-numpy Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install python-numpy using aptitude by running the following command:

sudo aptitude -y install python-numpy

How To Uninstall python-numpy on Debian 9

To uninstall only the python-numpy package we can use the following command:

sudo apt-get remove python-numpy

Uninstall python-numpy And Its Dependencies

To uninstall python-numpy and its dependencies that are no longer needed by Debian 9, we can use the command below:

sudo apt-get -y autoremove python-numpy

Remove python-numpy Configurations and Data

To remove python-numpy configuration and data from Debian 9 we can use the following command:

sudo apt-get -y purge python-numpy

Remove python-numpy configuration, data, and all of its dependencies

We can use the following command to remove python-numpy configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python-numpy

Dependencies

python-numpy have the following dependencies:

References

Summary

In this tutorial we learn how to install python-numpy package on Debian 9 using different package management tools: apt, apt-get and aptitude.