Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named scapy.all

I'm running macOS Sierra and Python 2.7.

In my terminal I've installed scapy with:

pip install scapy
Requirement already satisfied: scapy in /usr/local/lib/python2.7/site-packages

But running this:

from scapy.all import *

for pkt in sniff(iface='en0'):
    print pkt

Gives me this:

python test.py 
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    from scapy.all import *
ImportError: No module named scapy.all

I've tried and Google around, and installed pcapy and other packages - but no luck.

like image 243
Michael Nielsen Avatar asked Oct 06 '17 09:10

Michael Nielsen


1 Answers

If you are using ubuntu type: 'sudo apt-get install python3-scapy' for python version >= 3.

like image 188
nvsk. avinash Avatar answered Oct 15 '22 01:10

nvsk. avinash