1

我在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
4

1 回答 1

1

您的操作系统中似乎没有nmap安装。尝试做:sudo apt-get install nmap并稍后测试。

希望这可以帮助!

于 2013-06-24T20:25:35.597 回答