How To Install python36-pexpect on CentOS 7

In this tutorial we learn how to install python36-pexpect on CentOS 7. python36-pexpect is Unicode-aware Pure Python Expect-like module

Introduction

In this tutorial we learn how to install python36-pexpect on CentOS 7.

What is python36-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 python36-pexpect on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install python36-pexpect.

Install python36-pexpect on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install python36-pexpect

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

sudo dnf -y install python36-pexpect

How To Uninstall python36-pexpect on CentOS 7

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

sudo dnf remove python36-pexpect

References

Summary

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