Installing python-nmap

To proceed with the installation, unzip the downloaded package, jump to the new directory, and execute the installation command.

In this example, we are installing Version 0.5 from the source package:

It is also possible to install the module with the pip install tool, since it is in the official repository. To install the module, it is necessary to execute the command with administrator permissions or use the system superuser (sudo):

sudo apt-get install python-pip nmapsudo pip install python-nmap

Get Mastering Python for Networking and Security now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.