How to Install numpy in Python

v2.4.4 Data & Science Python >=3.11

Fundamental package for array computing in Python

Install pip install numpy

What is numpy?

Fundamental package for array computing in Python

NumPy is the fundamental package for scientific computing with Python.

- a powerful N-dimensional array object - sophisticated (broadcasting) functions - tools for integrating C/C++ and Fortran code - useful linear algebra, Fourier transform, and random number capabilities

NumPy requires and . Tests can then be run after installation with:

Quick Start

Minimal example to get started with numpy:

import numpy as np

arr = np.array([1, 2, 3, 4, 5])
print(arr.mean())   # 3.0
print(arr ** 2)     # [ 1  4  9 16 25]

matrix = np.zeros((3, 3))
print(matrix.shape) # (3, 3)

Installation

pip (standard)

pip install numpy

Virtual environment (recommended)

python -m venv venv
source venv/bin/activate   # Windows: venv\Scripts\activate
pip install numpy

pip3

pip3 install numpy

conda

conda install -c conda-forge numpy

Poetry

poetry add numpy

Verify the Installation

After installing, confirm the package is available:

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

If this prints a version number, installation succeeded. If you see a ModuleNotFoundError, see the errors section below.

Installation Errors

Common errors when installing numpy with pip.

ModuleNotFoundError: No module named 'numpy'

Cause: The package is not installed in the current Python environment.

Fix: Run pip install numpy. If using a virtual environment, ensure it is activated first.

ModuleNotFoundError: No module named 'numpy' (installed but still failing)

Cause: pip installed the package into a different Python than the one running your script.

Fix: Use python -m pip install numpy to install into the interpreter you are running.

ImportError: cannot import name 'X' from 'numpy'

Cause: The function or class does not exist in the installed version.

Fix: Check the version with pip show numpy and upgrade with pip install --upgrade numpy.

pip: command not found

Cause: pip is not in PATH or Python was not added to PATH during installation.

Fix: Try python -m pip install numpy. On macOS/Linux try pip3.

PermissionError: [Errno 13] Permission denied

Cause: No write access to the system Python package directory.

Fix: Use a virtual environment, or add --user: pip install --user numpy

SSL: CERTIFICATE_VERIFY_FAILED

Cause: pip cannot verify PyPI's SSL certificate — common behind corporate proxies.

Fix: Try: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org numpy

MemoryError when loading data

Cause: Dataset is too large to fit in RAM.

Fix: Read in chunks, filter columns on load, or consider Polars/Dask for out-of-core processing.

Runtime Errors

Common errors when using numpy after installation.

ValueError: operands could not be broadcast together with shapes

Cause: Two arrays have incompatible shapes for the operation.

Fix: Check shapes with a.shape and b.shape. Use .reshape() or np.expand_dims() to align them.

TypeError: ufunc did not contain a loop with signature matching types

Cause: Incompatible data types between arrays (e.g., mixing int and complex).

Fix: Cast to a compatible type: arr.astype(np.float64)

Recent Releases

VersionReleased
2.4.4 latest 2026-03-29
2.4.3 2026-03-09
2.4.2 2026-01-31
2.4.1 2026-01-10
2.4.0 2025-12-20

Full release history on PyPI →

Manage numpy

Upgrade to latest version

pip install --upgrade numpy

Install a specific version

pip install numpy==2.4.4

Uninstall

pip uninstall numpy

Check what is installed

pip show numpy

Last updated: 2026-04-11 • Data from PyPI