I am trying to install nmap
package on my mac. After I had completed the installation process described on the developer's site I tried to run the following code:
import nmap
def nmapScan(tgtHost, tgtPort):
nmScan = nmap.PortScanner()
So I got an error:
File "build/bdist.macosx-10.10-intel/egg/nmap/nmap.py", line 180, in __init__
nmap.nmap.PortScannerError: 'nmap program was not found in path. PATH is :/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin'
Ok. I found the path to python-nmap
package and added it manually to the PATH
. I believe that I have to add one that contains nmap.py
file. Here it is:
/Users/%username%/Documents/Python_docs/python-nmap-0.1.4/nmap
And I am still getting the same error. Does anyone know why? Is there someone else who had this problem before? I have searched through internet and there is nothing that helps me. Thank you!