Python scapy import error

2020-04-02 07:27发布

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?

标签: python scapy
8条回答
走好不送
2楼-- · 2020-04-02 08:01

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.

查看更多
可以哭但决不认输i
3楼-- · 2020-04-02 08:03

from kamene.all import * WARNING: No route found for IPv6 destination :: (no default route?). This affects only IPv6

Use this one instead of scapy.all

查看更多
The star\"
4楼-- · 2020-04-02 08:04

If you use Linux get this folder:

/usr/share/pyshared

If you not found scapy you must download and install this, for example for Ubuntu you can found this:

http://packages.ubuntu.com/precise/all/python-scapy/download

and download package and install this pack about 300 kb.

查看更多
孤傲高冷的网名
5楼-- · 2020-04-02 08:05

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

sudo apt-get install python-scapy

查看更多
等我变得足够好
6楼-- · 2020-04-02 08:07

Delete any file named scapy.py

查看更多
家丑人穷心不美
7楼-- · 2020-04-02 08:10

I think there was a change is scapy somewhere. I put the following code in my scapy projects so it remains compatible.

try:
    import scapy
except ImportError:
    del scapy
    from scapy import all as scapy
查看更多
登录 后发表回答