How To Install python-sphinx on CentOS 7

In this tutorial we learn how to install python-sphinx on CentOS 7. python-sphinx is Python documentation generator

Introduction

In this tutorial we learn how to install python-sphinx on CentOS 7.

What is python-sphinx

Sphinx is a tool that makes it easy to create intelligent and beautiful documentation for Python projects (or other documents consisting of multiple reStructuredText sources), written by Georg Brandl. It was originally created to translate the new Python documentation, but has now been cleaned up in the hope that it will be useful to many other projects. Sphinx uses reStructuredText as its markup language, and many of its strengths come from the power and straightforwardness of reStructuredText and its parsing and translating suite, the Docutils. Although it is still under constant development, the following features are already present, work fine and can be seen “in action” in the Python docs * Output formats LaTeX, for printable PDF versions * Extensive cross-references links for functions, classes, glossary terms and similar pieces of information * Hierarchical structure with automatic links to siblings, parents and children * Automatic indices * Code handling highlighter * Various extensions are available, e.g. for automatic testing of snippets and inclusion of appropriately formatted docstrings.

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

Install python-sphinx on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install python-sphinx

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

sudo dnf -y install python-sphinx

How To Uninstall python-sphinx on CentOS 7

To uninstall only the python-sphinx package we can use the following command:

sudo dnf remove python-sphinx

References

Summary

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