I am using python2 in ubuntu. Just started reading the documentation of nmap. After just using the PortScanner I get an error.
>>> import nmap
>>> nm = nmap.PortScanner()
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
nm = nmap.PortScanner()
File "usr/local/lib/python2.7/dist-packages/nmap/nmap.py", line 118, in __init__
p = subprocess.Popen(['nmap', '-V'], bufsize=1000, stdotut=subprocess.PIPE)
File "usr/lib/python2.7/subprocess,py", line 679, in __init__
File "usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
OSError: [Errno 2] No such file or directory
It seems you don't have
nmap installed in your OS. Try doing:
sudo apt-get install nmap and test it later.
Hope this helps!