How To Install python-recaptcha on Ubuntu 18.04

In this tutorial we learn how to install python-recaptcha on Ubuntu 18.04. python-recaptcha is client library for reCAPTCHA and Mailhide

Introduction

In this tutorial we learn how to install python-recaptcha on Ubuntu 18.04.

What is python-recaptcha

python-recaptcha is:

This Python package provides modules implementing clients for both reCAPTCHA and reCAPTCHA Mailhide.

reCAPTCHA hinders automated abuse of web sites (such as comment spam or bogus registrations) by using a CAPTCHA to try to ensure that humans are involved.

reCAPTCHA Mailhide allows web sites to obfuscate email addresses, revealing them only if a reCAPTCHA is solved.

These modules access a web service that requires sites running the reCAPCHA client to register (at no cost) for an API key. On the other hand, no imaging libraries or complex computations are needed to generate and check CAPTCHAs.

There are three methods to install python-recaptcha 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 python-recaptcha 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-recaptcha using apt-get by running the following command:

sudo apt-get -y install python-recaptcha

Install python-recaptcha Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install python-recaptcha

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

sudo aptitude -y install python-recaptcha

How To Uninstall python-recaptcha on Ubuntu 18.04

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

sudo apt-get remove python-recaptcha

Uninstall python-recaptcha And Its Dependencies

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

sudo apt-get -y autoremove python-recaptcha

Remove python-recaptcha Configurations and Data

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

sudo apt-get -y purge python-recaptcha

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

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

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

References

Summary

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