通过Homebrew Scapy on Mavericks“AttributeError:'module'对象没有属性'intf'”


3

我尝试通过Homebrew在OS X上安装Scapy,这似乎工作正常。
安装后,我通过Homebrew安装了一些Python模块。

现在,当我启动Scapy时,我收到以下错误:

INFO: Can't import python gnuplot wrapper . Won't be able to plot.
Traceback (most recent call last):
File "/usr/local/bin/scapy", line 25, in <module>
interact()
File "/usr/local/lib/python2.7/site-packages/scapy/main.py", line 278, in interact
scapy_builtins = __import__("all",globals(),locals(),".").__dict__
File "/usr/local/lib/python2.7/site-packages/scapy/all.py", line 25, in <module>
from route import *
File "/usr/local/lib/python2.7/site-packages/scapy/route.py", line 162, in <module>
conf.route=Route()
File "/usr/local/lib/python2.7/site-packages/scapy/route.py", line 22, in __init__
self.resync()
File "/usr/local/lib/python2.7/site-packages/scapy/route.py", line 31, in resync
self.routes = read_routes()
File "/usr/local/lib/python2.7/site-packages/scapy/arch/unix.py", line 86, in      read_routes
ifaddr = scapy.arch.get_if_addr(netif)
File "/usr/local/lib/python2.7/site-packages/scapy/arch/__init__.py", line 36, in get_if_addr
return socket.inet_ntoa(get_if_raw_addr(iff))
File "/usr/local/lib/python2.7/site-packages/scapy/arch/pcapdnet.py", line 187, in   get_if_raw_addr
i = dnet.intf()
AttributeError: 'module' object has no attribute 'intf'

有想法的人吗?

Answers:


1

我似乎已经为自己解决了这个问题,我认为这是由于一个腐败/错误的“鸡蛋”文件。我不能保证这会对你有用,但我在过去的两个月里,一字不差地遇到了这个问题。现在,我至少可以进入scapy

首先,我使用以下命令找到了我的Python安装路径:

python -c "import sys; print sys.path"

在我的例子中,前几个路径是各种.egg文件。尝试去除pydnet鸡蛋,在我的情况下称为鸡蛋PyDNET-0.92-py2.7.egg。在这一点上我还没有真正测试过,但scapy至少是靴子。所以我们知道问题必须在哪里。


0

我遇到了同样的问题(使用Scapy 2.2.0)并可以通过以下方式重新安装带有python绑定的libdnet来解决它:

brew install --with-python libdnet

不,这没有改变任何事情。
史蒂夫
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.