【问题标题】:'ImportError: No module named dumbnet' when trying to run a script that leverages scapy on OS X尝试在 OS X 上运行利用 scapy 的脚本时出现“ImportError:没有名为dumbnet 的模块”
【发布时间】:2017-03-09 09:33:21
【问题描述】:

所以,我正在尝试了解 Python 中的 scapy 库,并尝试运行使用 scapy 的脚本。该脚本通过以下方式导入模块:

from scapy.all import *

我看到了这个,当然安装了 scapy:

pip install scapy

接下来,我得到以下导入错误:

ImportError: No module named pcapy

所以,我决定用pip install pcapy 安装 pcapy。它安装得很好,但现在我收到以下导入错误:

ImportError: No module named dumbnet

我找不到名为dumbnet 的模块。有人知道这里发生了什么吗?

这是我第一次搞砸 scapy,并在激活的虚拟环境中使用安装了 Python 2.7 的 Mac。

编辑1:

这是完整的错误:

Traceback (most recent call last):
  File "syn_test.py", line 4, in <module>
    from scapy.all import * # The One and Only Scapy
  File "/Users/dasComputer/venv_mac/lib/python2.7/site-packages/scapy/all.py", line 16, in <module>
    from scapy.arch import *
  File "/Users/dasComputer/venv_mac/lib/python2.7/site-packages/scapy/arch/__init__.py", line 79, in <module>
    from scapy.arch.pcapdnet import *
  File "/Users/dasComputer/venv_mac/lib/python2.7/site-packages/scapy/arch/pcapdnet.py", line 471, in <module>
    import dumbnet as dnet
ImportError: No module named dumbnet

【问题讨论】:

  • 你应该接受投票最多的答案。

标签: python macos scapy


【解决方案1】:

dumbnet 也称为 libdnet。来源可以在 https://github.com/dugsong/libdnet。您可以在终端中运行以下命令,scapy 应该可以工作。

cd
git clone https://github.com/dugsong/libdnet.git
cd libdnet
./configure && make
cd python
python setup.py install

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-09
    • 2018-03-04
    • 2021-05-11
    • 1970-01-01
    相关资源
    最近更新 更多