nmap.nmap.PortScannerError: 'nmap program was not found in path

0 votes

I am facing some error while using python-nmap:

I am running the following:

import nmap
nm = nmap.PortScanner()

I am getting this error:

Traceback (most recent call last):   File "a.py", line 2, in <module>     nm = nmap.PortScanner()   File "/home/edureka/.local/lib/python2.7/site-packages/nmap/nmap.py", line 131, in __init__     os.getenv('PATH') nmap.nmap.PortScannerError: 'nmap program was not found in path. PATH is : /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin'
Jan 30 in Python by Sulith

1 answer to this question.

0 votes

python-nmap module used in python happens to use nmap binary installed in the system. The error you are getting is because python can't find the depending nmap.  Installing nmap should solve this. To install nmap, run the following command:

sudo apt-get install nmap 
answered Jan 30 by Omkar
• 67,660 points

Related Questions In Python

0 votes
1 answer

Section postgresql not found in the database.ini file

Python doesn't know what $FILEDIR is. Try an absolute path ...READ MORE

answered Oct 3, 2018 in Python by Priyaj
• 56,940 points
0 votes
1 answer

Installing package not found in conda

You can install pip in your conda env and then run pip ...READ MORE

answered Jul 31 in Python by SDeb
• 13,190 points
0 votes
1 answer

Raw_input method is not working in python3. How to use it?

raw_input is not supported anymore in python3. ...READ MORE

answered May 4, 2018 in Python by aayushi
• 750 points
0 votes
0 answers

Storing a list of arrays into a CSV file and retrieving it back in a different program

This is the code that I am ...READ MORE

Jun 6, 2018 in Python by ariaholic
• 7,340 points
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 351 views
+4 votes
6 answers
0 votes
2 answers
0 votes
1 answer

How to print a message or the error if a file is not found?

To print the message that file is not ...READ MORE

answered Jan 2 in Python by Omkar
• 67,660 points