Reputation: 299
I am trying to follow an online tutorial "Python For Ethical Hacking". I have the following code:
import nmap
nmap1 = nmap.PortScanner()
a = nmap1.map_version()
print(nmap)
However, I get the following error:
Traceback (most recent call last):
File "nmap_Test.py", line 3, in <module>
nmap1 = nmap.PortScanner()
AttributeError: module 'nmap' has no attribute 'PortScanner'
I have tried uninstalling the module and such but I have had no luck.
Upvotes: 1
Views: 3309
Reputation: 299
I found a solution. I installed nmap using brew and compiled the program as a root user.
brew install nmap
Upvotes: 1