用brew 安装scapy,执行 from scapy.all import *
会报错:
chu@sh3ll-me:~/Downloads/BHP-Code/Chapter4 » python mail_sniffer.py
Traceback (most recent call last):
File "mail_sniffer.py", line 2, in <module>
from scapy.all import *
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'
有人遇到过么,求解决方案.
1
wilsoncao 2015-01-23 23:40:32 +08:00
最近装了一个 但没有遇到这种情况,我是按照一个教程来做的但不是直接用brew这样粗暴的方法。。。感觉依赖包还是挺多的。。参考一下这个: http://scrapy-chs.readthedocs.org/zh_CN/latest/intro/install.html#intro-install
|
2
casparchen 2015-01-24 04:13:21 +08:00 1
@wilsoncao 楼主说的不是scrapy
|
3
wilsoncao 2015-01-24 08:27:29 +08:00
@casparchen 我错了。。。
|
4
chuhades OP 自己来结个贴,仔细看报错,是说dnet module没有intf 方法,发现自己的机子上装了两个dnet,一个是pip装的,还有一个dnet.so,删除了pip安装的那个就可以了。
|