简体   繁体   中英

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

I am getting an error that nmap is not found in my PATH (using python-nmap). However, it is in my PATH.

Nmap works when I execute my script in Python, but when I use pyinstaller to freeze the code to a .exe file, I get this error when I try to run my code:

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'

As you can see, I have Nmap in my PATH. Any thoughts?

I managed to get around this error by upgrading to Python 3.5. Was using Python 2.7.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM