我在ubuntu中使用python2。刚开始阅读nmap的文档。刚使用PortScanner后,我收到错误。
>>> 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__
errread, errwrite)
File "usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
答案 0 :(得分:1)
您的操作系统中似乎没有安装nmap
。尝试执行:sudo apt-get install nmap
并稍后进行测试。
希望这有帮助!