Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python scapy import error

Tags:

python

scapy

If I include following line in my python source file

from scapy.all import *

I get this error

from scapy.all import *
ImportError: No module named all

Which is true in Console and IDLE, but not eclipse. I am very much confused why this is happening. Can some one help me out?

like image 531
rda3mon Avatar asked Nov 25 '10 05:11

rda3mon


4 Answers

I want to contribute to this problem. Watch for files named "scapy" in your directory where u are using your script. I had one named "scapy.py" and obviously python tries to include from ".". I removed script and: import scapy.all import * works fine.

like image 109
romanikov Avatar answered Oct 24 '22 08:10

romanikov


If scapy is not installed in your system, then you can use this command to install scapy:

sudo apt-get install python-scapy

like image 37
Snake Eyes Avatar answered Oct 24 '22 10:10

Snake Eyes


I think this may be a problem with your version:

If you are using Scapy v1.X:

from scapy import *

Otherwise, with Scapy V2.X+

from scapy.all import *

Is the way to go.

Hope that helps!

like image 21
dc5553 Avatar answered Oct 24 '22 10:10

dc5553


Delete any file named scapy.py

like image 28
Utopia Avatar answered Oct 24 '22 08:10

Utopia