So, I wrote a little script in Ubuntu for scapy.
#!/usr/bin/env python
import sys
#from scapy.all import *
try
import scapy
except ImportError:
I had a similar problem on OSX, I installed the scapy package pip install scapy
and then I was trying to execute my test file scapy.py
The error I got was :
python scapy.py
Traceback (most recent call last):
File "scapy.py", line 1, in
from scapy.all import *
File "/Users/**/Desktop/scapy-test/scapy.py", line 1, in
from scapy.all import *
ModuleNotFoundError: No module named 'scapy.all'; 'scapy' is not a package
In my case, it was the file name itself that caused the problem it can't be called scapy.py
. I change it to test.py
and all worked, it had nothing to do with the package location just the file name.