簡體   English   中英

在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:沒有名為'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項目僅適用於Python2.x。 這是一個Python 3端口: http : //github.com/phaethon/scapy

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM