我只是尝试创建nmap.portscanner()对象。但是,每当我运行此代码行时,我都会收到以下错误
>>> import nmap
>>> nmap.PortScanner()
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
nmap.PortScanner()
File "C:Python32libsite-packagesnmapnmap.py", line 170, 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 : C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\QuickTime\QTSystem\'
我通过运行'python setup.py install'安装了nmap我如何使nmap工作?
- 确保安装NMAP并将其添加到文件路径中。
- 我正在使用Python 2.7,并且持续存在问题,这是解决方案:
- 打开nmap.py
- Goto Line 116
- 更改(http://nmap.org)到(https://nmap.org)