我在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
最佳答案
看来您的操作系统中没有安装nmap
。尝试执行:sudo apt-get install nmap
并稍后进行测试。
希望这可以帮助!
关于python - 无法使用python-nmap,OSError:[Errno] 2,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17284388/