2

i am trying to use the 'nmap' module in python.i am using windows, pycharm, python 3.6.i installed the python-nmap module(installing 'nmap' module was showing the error: nmap has no attribute called 'PortScanner') directly from inside the pycharm. I tried like 4 hours. cant solve this issue.

import nmap
ns = nmap.PortScanner()

running this gives the following error:

nmap.nmap.PortScannerError: "nmap program was not found in path. PATH is : 
C:\\ProgramData\\Oracle\\Java\\javapath;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\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Users\\Tanmay's\\AppData\\Local\\Programs\\Python\\Python36-32"

i'm new with python and nmap.. your help would be really appreciated.

Tan-007
  • 378
  • 3
  • 16
  • And yes i have tried everything possible.(editing the path, making the environment varible, looking on internet for solution..but no luck. – Tan-007 Jul 04 '17 at 10:11
  • 1
    Did you install `nmap`, not just the lib? – Cà phê đen Jul 04 '17 at 10:19
  • Is the nmap directory listed on the error message? If not try adding the nmap dir to the path via python (i.e. import sys; sys.path.append('path/to/nmap') ) – Davide Jul 04 '17 at 10:20
  • Still the same error.. @Davide – Tan-007 Jul 04 '17 at 10:41
  • How do i install nmap?? isn't it a module that can be added directly? can you tell me the whole process of setting up the nmap, please? @Càphêđen – Tan-007 Jul 04 '17 at 10:42
  • 2
    nmap is a separate program that looks like you haven't installed... [nmap download page](https://nmap.org/download.html) – Davide Jul 04 '17 at 10:49
  • Sorry, i didn't know that nmap is a separate program..installed it and it's working fine now.. very much thank you buddy @Davide – Tan-007 Jul 04 '17 at 11:00

0 Answers0