How To Install python3-pexpect on Rocky Linux 8

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

Introduction

In this tutorial we learn how to install python3-pexpect on Rocky Linux 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 Rocky Linux 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 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 python3-pexpect using dnf by running the following command:

sudo dnf -y install python3-pexpect

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

sudo yum -y install python3-pexpect

How To Uninstall python3-pexpect on Rocky Linux 8

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

sudo dnf remove python3-pexpect

python3-pexpect Package Contents on Rocky Linux 8

/usr/lib/python3.6/site-packages/pexpect
/usr/lib/python3.6/site-packages/pexpect-4.3.1-py3.6.egg-info
/usr/lib/python3.6/site-packages/pexpect/ANSI.py
/usr/lib/python3.6/site-packages/pexpect/FSM.py
/usr/lib/python3.6/site-packages/pexpect/__init__.py
/usr/lib/python3.6/site-packages/pexpect/__pycache__
/usr/lib/python3.6/site-packages/pexpect/__pycache__/ANSI.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/ANSI.cpython-36.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/FSM.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/FSM.cpython-36.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/__init__.cpython-36.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/_async.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/_async.cpython-36.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/exceptions.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/exceptions.cpython-36.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/expect.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/expect.cpython-36.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/fdpexpect.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/fdpexpect.cpython-36.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/popen_spawn.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/popen_spawn.cpython-36.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/pty_spawn.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/pty_spawn.cpython-36.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/pxssh.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/pxssh.cpython-36.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/replwrap.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/replwrap.cpython-36.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/run.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/run.cpython-36.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/screen.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/screen.cpython-36.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/spawnbase.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/spawnbase.cpython-36.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/utils.cpython-36.opt-1.pyc
/usr/lib/python3.6/site-packages/pexpect/__pycache__/utils.cpython-36.pyc
/usr/lib/python3.6/site-packages/pexpect/_async.py
/usr/lib/python3.6/site-packages/pexpect/bashrc.sh
/usr/lib/python3.6/site-packages/pexpect/exceptions.py
/usr/lib/python3.6/site-packages/pexpect/expect.py
/usr/lib/python3.6/site-packages/pexpect/fdpexpect.py
/usr/lib/python3.6/site-packages/pexpect/popen_spawn.py
/usr/lib/python3.6/site-packages/pexpect/pty_spawn.py
/usr/lib/python3.6/site-packages/pexpect/pxssh.py
/usr/lib/python3.6/site-packages/pexpect/replwrap.py
/usr/lib/python3.6/site-packages/pexpect/run.py
/usr/lib/python3.6/site-packages/pexpect/screen.py
/usr/lib/python3.6/site-packages/pexpect/spawnbase.py
/usr/lib/python3.6/site-packages/pexpect/utils.py
/usr/share/doc/python3-pexpect
/usr/share/doc/python3-pexpect/doc
/usr/share/doc/python3-pexpect/doc/FAQ.rst
/usr/share/doc/python3-pexpect/doc/Makefile
/usr/share/doc/python3-pexpect/doc/api
/usr/share/doc/python3-pexpect/doc/api/fdpexpect.rst
/usr/share/doc/python3-pexpect/doc/api/index.rst
/usr/share/doc/python3-pexpect/doc/api/pexpect.rst
/usr/share/doc/python3-pexpect/doc/api/popen_spawn.rst
/usr/share/doc/python3-pexpect/doc/api/pxssh.rst
/usr/share/doc/python3-pexpect/doc/api/replwrap.rst
/usr/share/doc/python3-pexpect/doc/clean.css
/usr/share/doc/python3-pexpect/doc/commonissues.rst
/usr/share/doc/python3-pexpect/doc/conf.py
/usr/share/doc/python3-pexpect/doc/examples.rst
/usr/share/doc/python3-pexpect/doc/history.rst
/usr/share/doc/python3-pexpect/doc/index.rst
/usr/share/doc/python3-pexpect/doc/install.rst
/usr/share/doc/python3-pexpect/doc/make.bat
/usr/share/doc/python3-pexpect/doc/overview.rst
/usr/share/doc/python3-pexpect/doc/requirements.txt
/usr/share/doc/python3-pexpect/doc/sphinxext
/usr/share/doc/python3-pexpect/doc/sphinxext/github.py
/usr/share/doc/python3-pexpect/examples
/usr/share/doc/python3-pexpect/examples/README
/usr/share/doc/python3-pexpect/examples/astat.py
/usr/share/doc/python3-pexpect/examples/cgishell.cgi
/usr/share/doc/python3-pexpect/examples/chess.py
/usr/share/doc/python3-pexpect/examples/chess2.py
/usr/share/doc/python3-pexpect/examples/chess3.py
/usr/share/doc/python3-pexpect/examples/df.py
/usr/share/doc/python3-pexpect/examples/ftp.py
/usr/share/doc/python3-pexpect/examples/hive.py
/usr/share/doc/python3-pexpect/examples/monitor.py
/usr/share/doc/python3-pexpect/examples/passmass.py
/usr/share/doc/python3-pexpect/examples/python.py
/usr/share/doc/python3-pexpect/examples/script.py
/usr/share/doc/python3-pexpect/examples/ssh_tunnel.py
/usr/share/doc/python3-pexpect/examples/table_test.html
/usr/share/doc/python3-pexpect/examples/topip.py
/usr/share/doc/python3-pexpect/examples/uptime.py
/usr/share/licenses/python3-pexpect
/usr/share/licenses/python3-pexpect/LICENSE

References

Summary

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