How To Install python-prettytable on Debian 9

In this tutorial we learn how to install python-prettytable on Debian 9. python-prettytable is library to represent tabular data in visually appealing ASCII tables

Introduction

In this tutorial we learn how to install python-prettytable on Debian 9.

What is python-prettytable

python-prettytable is:

PrettyTable is a simple Python library designed to make it quick and easy to represent tabular data in visually appealing ASCII tables. It was inspired by the ASCII tables used in the PostgreSQL shell psql. PrettyTable allows for selection of which columns are to be printed, independent alignment of columns (left or right justified or centred) and printing of “sub-tables” by specifying a row range.

There are three methods to install python-prettytable on Debian 9. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install python-prettytable Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install python-prettytable using apt-get by running the following command:

sudo apt-get -y install python-prettytable

Install python-prettytable Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install python-prettytable

Install python-prettytable Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install python-prettytable using aptitude by running the following command:

sudo aptitude -y install python-prettytable

How To Uninstall python-prettytable on Debian 9

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

sudo apt-get remove python-prettytable

Uninstall python-prettytable And Its Dependencies

To uninstall python-prettytable and its dependencies that are no longer needed by Debian 9, we can use the command below:

sudo apt-get -y autoremove python-prettytable

Remove python-prettytable Configurations and Data

To remove python-prettytable configuration and data from Debian 9 we can use the following command:

sudo apt-get -y purge python-prettytable

Remove python-prettytable configuration, data, and all of its dependencies

We can use the following command to remove python-prettytable configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge python-prettytable

Dependencies

python-prettytable have the following dependencies:

References

Summary

In this tutorial we learn how to install python-prettytable package on Debian 9 using different package management tools: apt, apt-get and aptitude.