Ubuntu 14.04 上的 scapy 导入错误
Import error for scapy on Ubuntu 14.04
我有兴趣在我的 python 代码中使用 scapy 作为一个包。
我按照说明安装了它,这是我的 python 代码(实际上这是从另一个网站获取的代码):
#!/usr/bin/python3.4
from scapy import *
ap_list = []
def PacketHandler(pkt) :
if pkt.haslayer(Dot11) :
if pkt.type == 0 and pkt.subtype == 8 :
if pkt.addr2 not in ap_list :
ap_list.append(pkt.addr2)
print("AP MAC: {} with SSID: {} ".format(pkt.addr2, pkt.info))
sniff(iface="mon0", prn = PacketHandler)
我收到以下错误:
"ImportError: No module named 'scapy' "
不过,就我而言,我在之前的帖子中看到了答案:
- Scapy 已经安装:
armand@ACPC:~$ sudo apt-get install python-scapy
[sudo] password for armand:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-scapy is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 169 not upgraded.
-目录/usr/share/pyshared包含scapy:
armand@ACPC:~$ cd /usr/share/pyshared/
armand@ACPC:/usr/share/pyshared$ ls
scapy scapy-2.2.0.egg-info
armand@ACPC:/usr/share/pyshared$
- Scapy 在解释器上运行:
armand@ACPC:/usr/share/pyshared$ scapy
INFO: Can't import python gnuplot wrapper . Won't be able to plot.
INFO: Can't import PyX. Won't be able to use psdump() or pdfdump().
WARNING: No route found for IPv6 destination :: (no default route?)
Welcome to Scapy (2.3.1)
>>>
当我将 scapy 作为库导入时可能存在问题,但我不知道它是什么。我在 Ubuntu14.04 上是 运行 python3.4。
预先感谢您的帮助 !
官方 scapy 项目仅适用于 Python 2.x。这是一个 Python 3 端口:http://github.com/phaethon/scapy
我有兴趣在我的 python 代码中使用 scapy 作为一个包。 我按照说明安装了它,这是我的 python 代码(实际上这是从另一个网站获取的代码):
#!/usr/bin/python3.4
from scapy import *
ap_list = []
def PacketHandler(pkt) :
if pkt.haslayer(Dot11) :
if pkt.type == 0 and pkt.subtype == 8 :
if pkt.addr2 not in ap_list :
ap_list.append(pkt.addr2)
print("AP MAC: {} with SSID: {} ".format(pkt.addr2, pkt.info))
sniff(iface="mon0", prn = PacketHandler)
我收到以下错误: "ImportError: No module named 'scapy' " 不过,就我而言,我在之前的帖子中看到了答案: - Scapy 已经安装:
armand@ACPC:~$ sudo apt-get install python-scapy
[sudo] password for armand:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-scapy is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 169 not upgraded.
-目录/usr/share/pyshared包含scapy:
armand@ACPC:~$ cd /usr/share/pyshared/
armand@ACPC:/usr/share/pyshared$ ls
scapy scapy-2.2.0.egg-info
armand@ACPC:/usr/share/pyshared$
- Scapy 在解释器上运行:
armand@ACPC:/usr/share/pyshared$ scapy
INFO: Can't import python gnuplot wrapper . Won't be able to plot.
INFO: Can't import PyX. Won't be able to use psdump() or pdfdump().
WARNING: No route found for IPv6 destination :: (no default route?)
Welcome to Scapy (2.3.1)
>>>
当我将 scapy 作为库导入时可能存在问题,但我不知道它是什么。我在 Ubuntu14.04 上是 运行 python3.4。 预先感谢您的帮助 !
官方 scapy 项目仅适用于 Python 2.x。这是一个 Python 3 端口:http://github.com/phaethon/scapy