('Nmap not found', )

2020-02-11 07:09发布

Where is the problem?

import nmap

I installed nmap and python, and when I use import nmap there is no any problem. But when use:

nmap.PortScanner()

this error is thrown:

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    nmap.PortScanner()
  File "./nmap/nmap.py", line 153, in __init__
    raise PortScannerError('nmap program was not found in path. PATH is:{0}'.format(os.getenv('PATH')))
nmap.nmap.PortScannerError: 'nmap program was not found in path. PATH is : /usr/lib    /lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:    /usr/local/games'"

标签: python
7条回答
家丑人穷心不美
2楼-- · 2020-02-11 08:07

I have had the same problem. Just type in a terminal:

sudo apt-get install nmap

and problem solved.

查看更多
登录 后发表回答