1、报错 from scapy.all import sr, IP, ICMP target="192.168.142.129" pkt = IP(dst="target")/ICMP() ans, unans = sr(pkt, timeout=1) for s, r in ans: print("Target is alive") print(r.sprintf("%IP.src% is alive")) 2、解决方法