How To Install netcdf4-python on AlmaLinux 8

In this tutorial we learn how to install netcdf4-python in AlmaLinux 8. netcdf4-python is Python/numpy interface to netCDF

Introduction

In this tutorial we learn how to install netcdf4-python on AlmaLinux 8.

What is netcdf4-python

netCDF version 4 has many features not found in earlier versions of the library and is implemented on top of HDF5. This module can read and write files in both the new netCDF 4 and the old netCDF 3 format, and can create files that are readable by HDF5 clients. The API modeled after Scientific.IO.NetCDF, and should be familiar to users of that module. Most new features of netCDF 4 are implemented, such as multiple unlimited dimensions, groups and zlib data compression. All the new numeric data types (such as 64 bit and unsigned integer types) are implemented. Compound and variable length (vlen) data types are supported, but the enum and opaque data types are not. Mixtures of compound and vlen data types (compound types containing vlens, and vlens containing compound types) are not supported.

We can use yum or dnf to install netcdf4-python on AlmaLinux 8. In this tutorial we discuss both methods but you only need to choose one of method to install netcdf4-python.

Install netcdf4-python on AlmaLinux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install netcdf4-python using dnf by running the following command:

sudo dnf -y install netcdf4-python

Install netcdf4-python on AlmaLinux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install netcdf4-python using yum by running the following command:

sudo yum -y install netcdf4-python

How To Uninstall netcdf4-python on AlmaLinux 8

To uninstall only the netcdf4-python package we can use the following command:

sudo dnf remove netcdf4-python

References

Summary

In this tutorial we learn how to install netcdf4-python on AlmaLinux 8 using yum and dnf.