Categories: TutorialsUbuntu

How to Install NumPy on Ubuntu 20.04 LTS

Written in Python and C, Numpy is a popular Python library used for scientific computing. It’s 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.

In this guide, we will demonstrate how to install Numpy on Ubuntu 20.04.

Step 1: Install PIP package manager

The easiest route 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 as shown.

$

Sponsored
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 as follows:

$ 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.

Step 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:

Sponsored
$ sudo apt install python3-numpy

When the installation of Numpy is done, verify the version of Numpy installed as follows

$ 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

Conclusion

And there you go! We have successfully installed Numpy on Ubuntu 20.04. Your thoughts and feedback on this guide are welcome.

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications including CCNA RS, SCP, and ACE. As an IT engineer and technical author, he writes for various websites.

Ubuntu Server Admin

Recent Posts

How to Install nvidia-smi on Ubuntu or Debian Linux

In this article, we will see how to install nvidia-smi on Ubuntu or Debian Linux.…

7 hours ago

How to Install clang tool on Ubuntu or Debian Linux

In this article, we will see how to install clang tool on Ubuntu or Debian…

1 day ago

How to resolve Ubuntu 20.04 Container Signature Errors on Raspberry Pi ARM Devices

When working with Docker containers on Raspberry Pi devices, you might encounter frustrating signature verification…

2 days ago

How to fix DNS Resolution Issues with OpenVPN on Ubuntu 18.04

You’ve recently upgraded to Ubuntu 18.04 and found that your OpenVPN connection no longer resolves…

2 days ago

How to Fix Ubuntu 18.04 System Monitor Launch Issues

Have you ever tried to open System Monitor on your Ubuntu 18.04 system only to…

3 days ago

What is System Hardening? Essential Checklists from OS to Applications

System hardening means locking down a system and reducing its attack surface: removing unnecessary software…

3 days ago