How To Install python3-unipath on CentOS 7

In this tutorial we learn how to install python3-unipath on CentOS 7. python3-unipath is Alternative to Python modules os, os.path and shutil

Introduction

In this tutorial we learn how to install python3-unipath on CentOS 7.

What is python3-unipath

Unipath is a package for doing pathname calculations and filesystem access in an object-oriented manner, an alternative to functions in os.path, shutil and glob, and even some functions in os.* It’s based on Jason Orendorffs path.py but does not adhere as strictly to the underlying functions’ syntax, in order to provide more user convenience and higher-level functionality. For example o p.mkdir() succeeds silently if the directory already exists, and o p.mkdir(True) creates intermediate directories a la os.makedirs. o p.rmtree(parents=True) combines shutil.rmtree, os.path.isdir, os.remove, and os.removedirs, to recursively remove whatever it is if it exists. o p.read_file(“rb”) returns the file’s contents in binary mode. o p.needs_update([other_path1, …]) returns True if p doesn’t exist or has an older timestamp than any of the others. o extra convenience functions in the unipath.tools module. dict2dir creates a directory hierarchy described by a dict. dump_path displays an ASCII tree of a directory hierarchy.

We can use yum or dnf to install python3-unipath on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install python3-unipath.

Install python3-unipath on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install python3-unipath

Install python3-unipath on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

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

sudo dnf -y install python3-unipath

How To Uninstall python3-unipath on CentOS 7

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

sudo dnf remove python3-unipath

References

Summary

In this tutorial we learn how to install python3-unipath on CentOS 7 using yum and dnf.