Install Numpy on Ubuntu 18.04 Bionic Beaver Linux

Objective

The objective is to install Numpy on Ubuntu 18.04 Bionic Beaver Linux.

Operating System and Software Versions

  • Operating System: – Ubuntu 18.04 Bionic Beaver Linux
  • Software: – Python 2 & Python 3

Requirements

Privileged access to your Ubuntu System as root or via sudo command is required.

Conventions

  • # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
  • $ – requires given linux commands to be executed as a regular non-privileged user

Other Versions of this Tutorial

Ubuntu 20.04 (Focal Fossa)

Instructions

Python 2

Install Numpy Module from Ubuntu repository

The recommended approach is to install the stable Numpy module directly from the Ubuntu repository:

$ sudo apt install python-numpy

Check for the Numpy module version:

$ python -c "import numpy; print(numpy.__version__)"
1.13.3
install numpy python 2 - ubuntu 18.04 Bionic beaver

Numpy Python module on Ubuntu 18.04



Install Numpy Module using PIP

Once you have an appropriate PIP python version installed, you can also install Numpy by executing the bellow command:

$ pip install numpy

Check for the Numpy version number:

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

Python 3

Install Numpy Module from Ubuntu repository

You can install the Numpy module for Python 3 from the standard Ubuntu repository by executing the following linux command:

$ sudo apt install python3-pip

Check for the Numpy’s version:

$ python3 -c "import numpy; print(numpy.__version__)"
1.13.3
install numpy python 3 - ubuntu 18.04 Bionic beaver

Numpy Python 3 module on Ubuntu 18.04

Install Numpy Module using PIP

Using the appropriate PIP python version installed on your system execute the following pip3 command to install the python Numpy module:

$ pip3 install numpy

All done. Check for the Numpy’s version:

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