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
308 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 65,820 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,100 points
31 views
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
81 views
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,320 points
24 views
0 votes
1 answer

How to add to the python path in Windows?

You know what has worked for me ...READ MORE

answered Jul 25, 2018 in Python by Frankie
• 9,570 points
36 views
0 votes
1 answer

how can i count the items in a list?

suppose you have a list a = [0,1,2,3,4,5,6,7,8,9,10] now ...READ MORE

answered May 2 in Python by Mohammad
• 1,400 points
19 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
• 65,820 points
10 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.