How to check the NumPy version installed on your Raspberry Pi and update it if needed

A step-by-step guide on checking and updating NumPy version on Raspberry Pi, a popular single board computer for learning programming, electronics, and robotics. …


Updated October 8, 2023

Need help with your Raspberry Pi?
Contact Me!

Do you love silly Raspberry Pi Projects?
Check out my this YouTube Channel!


A step-by-step guide on checking and updating NumPy version on Raspberry Pi, a popular single board computer for learning programming, electronics, and robotics.

NumPy (Numerical Python) is a popular Python library used for scientific computing that provides support for large, multi-dimensional arrays and matrices, along with a wide range of mathematical functions to operate on these arrays. It’s commonly used in data science, machine learning, and other fields where mathematical computations are involved. In this article, we will learn how to check the NumPy version installed on your Raspberry Pi and update it if needed.

Before proceeding, make sure you have Python and pip (Python package manager) installed on your Raspberry Pi. If not, follow this guide to install them: https://www.raspberrypi.org/documentation/linux/software/python.md.

To check the NumPy version installed on your Raspberry Pi, open a terminal and run the following command:

pip show numpy

This will output information about the NumPy package including its version. Look for the line that says “Version:” to find the current version number. For example:

Name: numpy
Version: 1.21.4
Summary: NumPy: array processing for numbers, strings, records, and objects.
Home-page: https://www.numpy.org
Author: Travis E. Oliphant et al.
Author-email: None
License: BSD
Location: /usr/lib/python3/dist-packages
Requires: 
Required-by: pandas, scipy, tensorflow

In this example, the NumPy version installed is 1.21.4.

To update NumPy to the latest version, run the following command in the terminal:

sudo pip install --upgrade numpy

This will download and install the latest version of NumPy available from the Python Package Index (PyPI). If you encounter any errors during the installation process, try upgrading pip first by running:

sudo pip install --upgrade pip

Once the upgrade is complete, repeat the above command to update NumPy.

After the update, run pip show numpy again to verify that the version has been updated successfully.

Note: If you’re using a virtual environment for your Python projects, make sure to activate it before running the commands to check and update NumPy. Otherwise, the updates will be system-wide and may affect other projects.