Open In App

How to Install Rasterio on Linux?

Rasterio is a python library for reading and writing on geospatial raster datasets. It is a GDAL and NumPy-based Python library for raster data. We can use any of the following methods to install Rasterio on our Linux machine.

Method 1: Using pip command

Prerequisites:



We must have pip ( a python package manager) installed on our Linux machine.

Step 1: Add the Rasterio repository on your Linux machine, run the following command:



sudo add-apt-repository ppa:ubuntugis/ppa

    Step 1: Install the required dependencies for Rasterio before starting the actual installation of Rasterio.

pip install -U pip

After installing pip, run the following command to install Rasterio on a Linux machine.

pip install rasterio

Output:

installing rasterio

Method 2: Using built-in system package manager

    Step 1: Open up your Linux terminal and type the following command and hit enter.

sudo apt-get install -y python3-rasterio

Output:

installing rasterio using pip.

Method 3: Using aptitude package manager

Aptitude is a package manager, it is a frontend to apt. It is a Debian package manager. It helps us to install packages by displaying a list of software packages and allows us to interactively pick packages to install or remove.

Step 1: You must have aptitude installed on your system. Run the following command to install aptitude:

sudo apt install aptitude

Output:

installing aptitude 

Step 2: Run the following command to install Rasterio.

sudo aptitude install rasterio

Output:

installing rasterio using aptitude 

Article Tags :