How To Install python-flake8 on CentOS 7

In this tutorial we learn how to install python-flake8 on CentOS 7. python-flake8 is Code checking using pep8 and pyflakes

Introduction

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

What is python-flake8

Flake8 is a wrapper around these tools - PyFlakes - pep8 - Ned’s McCabe script Flake8 runs all tools by launching the single ‘flake8’ script, but ignores pep8 and PyFlakes extended options and just uses defaults. It displays the warnings in a per-file, merged output. It also adds a few features - files that contains with this header are skipped - lines that contains a “# NOQA” comment at the end will not issue a warning. - a Mercurial hook. - a McCabe complexity checker.

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

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

sudo yum -y install python-flake8

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

sudo dnf -y install python-flake8

How To Uninstall python-flake8 on CentOS 7

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

sudo dnf remove python-flake8

References

Summary

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