Python Nmap Path Error

2019-07-10 23:17发布

Python imports NMap fine but when I do a basic variable assignment it returns an error:

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'

标签: python nmap
1条回答
我想做一个坏孩纸
2楼-- · 2019-07-10 23:39

I also encountered this problem. I solved it by installing nmap. After adding the nmap.exe directory in the PATH variable, I did not get this issue anymore.

查看更多
登录 后发表回答