Install NumPy on Ubuntu 20.04 LTS - Step by step guide ?

Numpy is a popular Python library used for scientific computing written in Python and C. Its hugely popular in data science and a de facto standard for handling numerical data in Python programming. Numpy API is extensively used in other Python libraries such as matplotlib, SciPy, Pandas and so many more.

Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform related Python library queries.

In this context, we shall look into how to install Numpy on Ubuntu 20.04.


Steps to install and configure Numpy on Ubuntu Linux system 

1. Install PIP package manager

The easiest way to install Numpy is to use the pip utility which is one of the most widely-used Python package managers. But first, update your system:

$ sudo apt update

To install pip first ensure Python is installed. Thankfully, Python3 is installed by default in Ubuntu 20.04. You can confirm this by running the command:

$ python3 -V

OR

$ python3 --version

Next, install pip3 with the below command:

$ sudo apt install python3-pip

Once installed, confirm the version of pip installed:

$ pip3 --version

This displays not only the version of PIP but also the binary location of the package.


2. Install Numpy on Ubuntu 20.04

With PIP installed, the next course of action is to install Numpy. To do this, execute the command:

$ sudo apt install python3-numpy

When the installation of Numpy is done, verify the version of Numpy installed:

$ python3 -c "import print; print(numpy.__version__)"

Alternatively, you can access the Python shell:

$ python3

Import Numpy:

>>> import numpy

Next, check the version of Numpy installed:

print(numpy.__version__)

Note that the underscores are double underscores and not single underscores.

If you wish to upgrade Numpy in the future, simply run:

$ pip3 install --upgrade numpy


[Need to configure any Software on your Linux system ? We can help you. ]

This article covers how to install Numpy on Ubuntu 20.04. In fact, NumPy(Numerical Python) is a library for the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-levelmathematicalfunctions to operate on these arrays.

Related Posts