How to Solve NameError: name 'sr1' is not defined -- scapy

Solution: Import the 'sr1' module

To Solve the error, add the following line to the top of your code.

from scapy import sr1

 

For more information:
Python scapy sr1