How To Install netcdf4-python on Rocky Linux 8

In this tutorial we learn how to install netcdf4-python on Rocky Linux 8. netcdf4-python is Python/numpy interface to netCDF

Introduction

In this tutorial we learn how to install netcdf4-python on Rocky Linux 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 Rocky Linux 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 Rocky Linux 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 Rocky Linux 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 Rocky Linux 8

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

sudo dnf remove netcdf4-python

netcdf4-python Package Contents on Rocky Linux 8

/usr/bin/nc3tonc4
/usr/bin/nc4tonc3
/usr/bin/ncinfo
/usr/share/licenses/netcdf4-python
/usr/share/licenses/netcdf4-python/COPYING

References

Summary

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