How To Install python3-pexpect on AlmaLinux 8

In this tutorial we learn how to install python3-pexpect in AlmaLinux 8. python3-pexpect is Unicode-aware Pure Python Expect-like module

Introduction

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

What is python3-pexpect

Pexpect is a pure Python module for spawning child applications; controlling them; and responding to expected patterns in their output. Pexpect works like Don Libes’ Expect. Pexpect allows your script to spawn a child application and control it as if a human were typing commands. This package contains the python3 version of this module. Pexpect can be used for automating interactive applications such as ssh, ftp, passwd, telnet, etc. It can be used to automate setup scripts for duplicating software package installations on different servers. And it can be used for automated software testing. Pexpect is in the spirit of Don Libes’ Expect, but Pexpect is pure Python. Unlike other Expect-like modules for Python, Pexpect does not require TCL or Expect nor does it require C extensions to be compiled. It should work on any platform that supports the standard Python pty module.

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

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

sudo dnf -y install python3-pexpect

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

sudo yum -y install python3-pexpect

How To Uninstall python3-pexpect on AlmaLinux 8

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

sudo dnf remove python3-pexpect

References

Summary

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