Skip to content
Follow
Ubuntu Linux

How to Install NumPy on Ubuntu 24.04

Richard
Written by
Richard
Jan 10, 2025 Updated Sep 15, 2026 2 min read
How to Install NumPy on Ubuntu 24.04
How to Install NumPy on Ubuntu 24.04

NumPy is a Python library that handles large arrays of numbers and fast math calculations on Ubuntu 24.04. Python programs run complex number crunching much faster with this package installed because the core parts use C and Fortran code behind the scenes.

Advertisement

Data analysis and scientific projects rely on this speed boost to process information quickly without slowing down your system.

⚡ Quick Answer

You can install NumPy on Ubuntu 24.04 using the APT package manager. Open your terminal and run sudo apt install python3-numpy. This command installs NumPy and any necessary dependencies from the Ubuntu repositories.

Advertisement

Install Python and Pip

Python and Pip are required prerequisites for installing NumPy on Ubuntu 24.04, and terminal commands fetch both dependencies.

🐧Bash / Shell
sudo apt update && sudo apt upgrade
sudo apt install python3 python3-pip

Install Python and Pip on Ubuntu Linux

NumPy Using APT

Retrieving NumPy from official Ubuntu software sources via APT offers the most direct deployment path.

Execute this command to install NumPy:

Advertisement
🐧Bash / Shell
sudo apt install python3-numpy

The package manager resolves all required dependencies automatically during this process.

Install NumPy Using Python Virtual Environment

You can install NumPy on Ubuntu 24.04 inside a Python virtual environment to keep your project packages organised and prevent version conflicts with other software. A virtual environment creates an isolated workspace for your project. First, install the virtual environment tool by opening your terminal and running sudo apt install python3.12-venv.

Run this command to install the required Python environment packages:

🐧Bash / Shell
sudo apt install python3.12-venv

Create a dedicated virtual environment named myenv for your project next:

Advertisement
💻Code
python3 -m venv myenv

Activation makes the isolated workspace active in the terminal session.

💻Code
source myenv/bin/activate

Specific package versions install successfully inside active environments.

💻Code
pip install numpy==VERSION

Implementation follows this pattern:

💻Code
pip install numpy==1.26.3

Test the module import afterward to confirm proper installation.

Advertisement
💻Code
python3
import numpy as np

Output the installed version string with this execution:

💻Code
print(np.__version__)

Deactivating the virtual environment returns the terminal to the global system state.

💻Code
deactivate

Configuration finishes here.

Summary:

Advertisement

Multiple deployment methods exist for adding NumPy to Ubuntu 24.04 systems. Core takeaways include:

  • Versatile Library: NumPy is essential for numerical and scientific computing, offering various mathematical functions and support for multi-dimensional arrays.
  • Installation Methods: You can install NumPy using the APT method for ease or create a virtual environment for better project dependency management.
  • Python Requirement: Ensure that you have Python and Pip installed before proceeding with the installation of NumPy.
  • Version Control: Installing NumPy in a virtual environment allows you to manage different library versions easily, which is particularly useful for multiple projects.
  • Verifying Installation: Always verify the installation by checking the NumPy version to confirm that the library is set up correctly.

Numerical computing tasks on Ubuntu 24.04 execute reliably once these configuration steps complete.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

📚 Related Tutorials

How to Install Python on Ubuntu Linux
Ubuntu Linux How to Install Python on Ubuntu Linux
How to Install GNOME Desktop on Ubuntu 24.04
Ubuntu Linux How to Install GNOME Desktop on Ubuntu 24.04
How to Install KDE Desktop on Ubuntu 24.04
Ubuntu Linux How to Install KDE Desktop on Ubuntu 24.04
How to Install WebStorm on Ubuntu 24.04
Ubuntu Linux How to Install WebStorm on Ubuntu 24.04

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *