2

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'
4

1 回答 1

3

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

于 2012-12-13T08:55:52.717 回答