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 like to add something to @Daniel answer. Your real problem is not scapy package. Your real problem is in your python file name. Don't ever use library name or its contents as your file name.
In your case, your file name is scapy.py
. After that you import scappy. In here you accidentally call your python file as object in your code there for your compiler can't understand which type(file or library) to call. There for that error was appeared.