Python的Nmap的路径出错(Python Nmap Path Error)

2019-09-24 06:03发布

Python导入NMap的罚款,但是当我做一个基本的变量赋值它返回一个错误:

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    nm = nmap.PortScanner()
  File "C:\Python32\lib\site-packages\nmap\nmap.py", line 144, 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:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files (x86)\\Intel\\iCLS Client\\;C:\\Program Files\\Intel\\iCLS Client\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Intel\\DMIX;C:\\Program Files (x86)\\Microsoft SQL Server\\90\\Tools\\binn\\;C:\\Python32\\Lib\\;C:\\Python32\\Tools\\Scripts;C:\\Program Files (x86)\\Common Files\\Intuit\\QBPOSSDKRuntime;C:\\Program Files (x86)\\Java\\jdk1.7.0_05\\bin;C:\\Program Files (x86)\\Java\\jdk1.7.0_05;C:\\Program Files (x86)\\Java\\jdk1.7.0_05\\jre\\bin\\client;C:\\Program Files (x86)\\Android;N:\\PortableApps\\Android_SDK\\tools;N:\\PortableApps\\Android_SDK\\platform-tools;C:\\Python32;C:\\Python32\\Lib;C:\\Python32\\Scripts;C:\\Python32\\Lib\\site-packages;C:\\Python32\\Lib\\site-packages\\android.py;C:\\Python32\\Lib\\site-packages;C:\\Python32\\Lib\\site-packages\\nmap'

Answer 1:

我也遇到了这个问题。 我通过安装nmap的解决了这个问题。 在PATH变量添加nmap.exe目录后,我没有再得到这个问题。



文章来源: Python Nmap Path Error
标签: python nmap