ndurvasula
ndurvasula

Reputation: 185

Python nmap portscanner error

I am simply trying to create a nmap.PortScanner() object. However, whenever I run this line of code I get the following error

>>> import nmap
>>> nmap.PortScanner()
Traceback (most recent call last):
  File "<pyshell#5>", line 1, in <module>
    nmap.PortScanner()
  File "C:\Python32\lib\site-packages\nmap\nmap.py", line 170, 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:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\ATI Technologies\\ATI.ACE\\Core-Static;C:\\Program Files (x86)\\QuickTime\\QTSystem\\'

I have installed nmap by running 'python setup.py install' How do I get nmap working?

Upvotes: 0

Views: 4944

Answers (1)

seth
seth

Reputation: 26

  1. make sure you install nmap and add it to your file path.
  2. I'm using python 2.7 and had continued problems, here was the fix:

Upvotes: 1

Related Questions