On Windows 10 (PyCharm IDE), i tried import the pythone-nmap module to get PortScenner. The code i wrote:
import nmap
ns = nmap.PortScanner()
a = ns.nmap_version()
print(a)
Afterward, i got the following error:
C:\Users\Mind1\AppData\Local\Programs\Python\Python36-32\python.exe C:/Users/Mind1/PycharmProjects/testNmap/main.py
Traceback (most recent call last):
File "C:/Users/Mind1/PycharmProjects/testNmap/main.py", line 2, in
ns = nmap.PortScanner()
File "C:\Users\Mind1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\nmap\nmap.py", line 131, in init
os.getenv('PATH')
nmap.nmap.PortScannerError: 'nmap program was not found in path.
PATH is : C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\WINDOWS\System32\OpenSSH\;C:\Users\Mind1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\nmap\nmap.py;C:\tizen-studio\tools\ide\bin;C:\Users\Mind1\AppData\Local\Programs\Python\Python36-32\Scripts\;C:\Users\Mind1\AppData\Local\Programs\Python\Python36-32\;C:\Users\Mind1\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Programing\SQLite3;C:\Users\Mind1\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\PyCharm Community Edition 2019.2.3\bin;;C:\Users\Mind1\AppData\Local\Programs\Python\Python36-32\lib\site-packages\nmap\nmap.py;'
My questions are: Why isn't it found in the path, when it is there at the end of the path? Why are there 2 semi-colon before the last part of the path?
ps: I tried to add the path within the () of the PortScanner(), but that hasn't worked neither. (Not even when I used the double \ signs.