使用Python 3(以PyCharm作为我的IDE)和运行OS Mojave(版本10.14.6)的Mac。我尝试使用终端命令python-nmap
安装python-nmap install
。很好但是,当尝试使用nmap.PortScanner
时,我不断收到此错误:
“ AttributeError:模块'nmap'没有属性'PortScanner'”。
该怎么办?
import nmap
ns = nmap.PortScanner()
print(ns.nmap_version())
ns.scan('**IP Address goes here, not actually uploading an IP but I know it goes here, this isn't the problem**', '1-1024', '-v')
print(ns.scaninfo())
print(ns.csv())