How To Install python3-netcdf4 on AlmaLinux 8

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

Introduction

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

What is python3-netcdf4

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 python3-netcdf4 on AlmaLinux 8. In this tutorial we discuss both methods but you only need to choose one of method to install python3-netcdf4.

Install python3-netcdf4 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 python3-netcdf4 using dnf by running the following command:

sudo dnf -y install python3-netcdf4

Install python3-netcdf4 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 python3-netcdf4 using yum by running the following command:

sudo yum -y install python3-netcdf4

How To Uninstall python3-netcdf4 on AlmaLinux 8

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

sudo dnf remove python3-netcdf4

References

Summary

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