How To Install py3c-dev on Ubuntu 18.04

In this tutorial we learn how to install py3c-dev on Ubuntu 18.04. py3c-dev is Python 2/3 compatibility layer for C extensions

Introduction

In this tutorial we learn how to install py3c-dev on Ubuntu 18.04.

What is py3c-dev

py3c-dev is:

py3c is a library for easing porting C extensions to Python 3, providing macros for single-source compatibility between Python 2.6, 2.7, and 3.3+. It could be described as “the six for C extensions”.

There are three methods to install py3c-dev on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install py3c-dev Using apt-get

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

sudo apt-get update

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

sudo apt-get -y install py3c-dev

Install py3c-dev Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install py3c-dev

Install py3c-dev 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 Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

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

sudo aptitude -y install py3c-dev

How To Uninstall py3c-dev on Ubuntu 18.04

To uninstall only the py3c-dev package we can use the following command:

sudo apt-get remove py3c-dev

Uninstall py3c-dev And Its Dependencies

To uninstall py3c-dev and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove py3c-dev

Remove py3c-dev Configurations and Data

To remove py3c-dev configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge py3c-dev

Remove py3c-dev configuration, data, and all of its dependencies

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

sudo apt-get -y autoremove --purge py3c-dev

References

Summary

In this tutorial we learn how to install py3c-dev package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.