PortScannerError 'nmap program not found in path'(但它在路径中)

PortScannerError 'nmap program not found in path' (but it is in path)

我收到一条错误消息,指出在我的 PATH 中找不到 nmap(使用 python-nmap)。但是,它在我的路径中。

当我在 Python 中执行脚本时 Nmap 工作,但是当我使用 pyinstaller 将代码冻结到 .exe 文件时,当我尝试 运行 我的代码时出现此错误:

Traceback (most recent call last):
  File "utils\map_network.py", line 7, in scan_network
  File "site-packages\nmap\nmap.py", line 131, in __init__
PortScannerError: 'nmap program was not found in path. PATH is : 

C:\Program Files (x86)\Intel\iCLS Client\;
C:\Program Files\Intel\iCLS Client\;
C:\ProgramData\Oracle\Java\javapath;
C:\windows\system32;C:\windows;
C:\windows\System32\Wbem;
C:\windows\System32\WindowsPowerShell\v1.0\;
C:\Python27\;
C:\Python27\Scripts\;
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;
C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;
C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;

C:\Program Files (x86)\Nmap;

C:\Users\sillico\AppData\Local\Microsoft\WindowsApps;
C:\Users\sillico\AppData\Local\Programs\Git\cmd'

如您所见,我的 PATH 中有 Nmap。有什么想法吗?

我通过升级到 Python 3.5 设法解决了这个错误。正在使用 Python 2.7.