How to Install rasterio in Python

v1.5.0 Data & Science Python >=3.12

Fast and direct raster I/O for use with NumPy

Install pip install rasterio

What is rasterio?

Fast and direct raster I/O for use with NumPy

Rasterio reads and writes geospatial raster data.

Geographic information systems use GeoTIFF and other formats to organize and store gridded, or raster, datasets. Rasterio reads and writes these formats and provides a Python API based on N-D arrays.

Rasterio 1.5+ works with Python >= 3.12, Numpy >= 2, and GDAL >= 3.8. Official binary packages for Linux, macOS, and Windows with most built-in format drivers plus HDF5, netCDF, and OpenJPEG2000 are available on PyPI.

Quick Start

Minimal example to get started with rasterio:

import rasterio

print(rasterio.__version__)

Installation

pip (standard)

pip install rasterio

Virtual environment (recommended)

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

pip3

pip3 install rasterio

conda

conda install -c conda-forge rasterio

Poetry

poetry add rasterio

Dependencies

Installing rasterio will also install these packages:

Verify the Installation

After installing, confirm the package is available:

python -c "import rasterio; print(rasterio.__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 rasterio with pip.

ModuleNotFoundError: No module named 'rasterio'

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

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

ModuleNotFoundError: No module named 'rasterio' (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 rasterio to install into the interpreter you are running.

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

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

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

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

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 rasterio

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.

Recent Releases

VersionReleased
1.5.0 latest 2026-01-05
1.5rc1 2025-12-30
1.5rc0 2025-12-29
1.5a1 2025-12-23
1.5a0 2025-12-15

Full release history on PyPI →

Manage rasterio

Upgrade to latest version

pip install --upgrade rasterio

Install a specific version

pip install rasterio==1.5.0

Uninstall

pip uninstall rasterio

Check what is installed

pip show rasterio

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