How To Install ptpython2 on CentOS 7

In this tutorial we learn how to install ptpython2 on CentOS 7. ptpython2 is Python REPL build on top of prompt_toolkit

Introduction

In this tutorial we learn how to install ptpython2 on CentOS 7.

What is ptpython2

Ptpython is an advanced Python REPL built on top of the prompt_toolkit library. It features syntax highlighting, multiline editing (the up arrow works), autocompletion, mouse support, support for color schemes, support for bracketed paste, both Vi and Emacs key bindings, support for double width (Chinese) characters, and many other things.

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

Install ptpython2 on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install ptpython2 using yum by running the following command:

sudo yum -y install ptpython2

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

sudo dnf -y install ptpython2

How To Uninstall ptpython2 on CentOS 7

To uninstall only the ptpython2 package we can use the following command:

sudo dnf remove ptpython2

References

Summary

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