How To Install python-debug on CentOS 7

In this tutorial we learn how to install python-debug on CentOS 7. python-debug is Debug version of the Python runtime

Introduction

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

What is python-debug

python-debug provides a version of the Python runtime with numerous debugging features enabled, aimed at advanced Python users, such as developers of Python extension modules. This version uses more memory and will be slower than the regular Python build, but is useful for tracking down reference-counting issues, and other bugs. The bytecodes are unchanged, so that .pyc files are compatible between the two version of Python, but the debugging features mean that C/C++ extension modules are ABI-incompatible with those built for the standard runtime. It shares installation directories with the standard Python runtime, so that .py and .pyc files can be shared. All compiled extension modules gain a “_d” suffix (“foo_d.so” rather than “foo.so”) so that each Python implementation can load its own extensions.

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

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

sudo yum -y install python-debug

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

sudo dnf -y install python-debug

How To Uninstall python-debug on CentOS 7

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

sudo dnf remove python-debug

References

Summary

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