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, 2019 in Python by Sulith
1,709 views

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, 2019 by Omkar
• 68,860 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
• 57,490 points
362 views
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, 2019 in Python by SDeb
• 13,230 points
279 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
256 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 Aryya
• 7,340 points
54 views
0 votes
1 answer
+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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 527 views
0 votes
0 answers
+4 votes
6 answers
+1 vote
2 answers

Not able to install speech_recognition in python: ModuleNotFoundError: No module named 'speech_recognition'

Hey. You have to use SpeechRecognition as module ...READ MORE

answered Nov 28, 2018 in Python by Omkar
• 68,860 points
4,788 views
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, 2019 in Python by Omkar
• 68,860 points
53 views