Logo Questions Linux Laravel Mysql Ubuntu Git Menu

Best method of importing scapy

I've used: from scapy.all import * in the past however now I am getting conflicts (Queue) within the namespace.

Whats the best method to import scapy? Methods I've looked into:

import scapy
import scapy.all
from scapy import all
like image 250
geekscrap Avatar asked Mar 17 '23 01:03


2 Answers

I often use, when I do not want to overwrite my namespace:

from scapy import all as scapy

After that everything is accessible under scapy.:

like image 149
Pierre Avatar answered Mar 30 '23 02:03


from scapy.all import sr1,IP,ICMP

Is probably the best way of doing this.

To import all the layers at once (to test packets against them) use:

from scapy.layers import all
like image 37
geekscrap Avatar answered Mar 30 '23 00:03