推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
chu1337
V2EX  ›  Python

mac 安装 scapy 报错

  •  
  •   chu1337 ·
    Q2h1Cg · Jan 23, 2015 · 5587 views
    This topic created in 4201 days ago, the information mentioned may be changed or developed.

    用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'
    

    有人遇到过么,求解决方案.

    4 replies    2015-01-25 20:36:01 +08:00
    wilsoncao
        1
    wilsoncao  
       Jan 23, 2015
    最近装了一个 但没有遇到这种情况,我是按照一个教程来做的但不是直接用brew这样粗暴的方法。。。感觉依赖包还是挺多的。。参考一下这个: http://scrapy-chs.readthedocs.org/zh_CN/latest/intro/install.html#intro-install
    casparchen
        2
    casparchen  
       Jan 24, 2015   ❤️ 1
    @wilsoncao 楼主说的不是scrapy
    wilsoncao
        3
    wilsoncao  
       Jan 24, 2015
    @casparchen 我错了。。。
    chu1337
        4
    chu1337  
    OP
       Jan 25, 2015
    自己来结个贴,仔细看报错,是说dnet module没有intf 方法,发现自己的机子上装了两个dnet,一个是pip装的,还有一个dnet.so,删除了pip安装的那个就可以了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2649 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 01:25 · PVG 09:25 · LAX 18:25 · JFK 21:25
    ♥ Do have faith in what you're doing.