简体   繁体   English

Scapy-OSError:没有这样的文件或目录

[英]Scapy - OSError: No such file or directory

I've tried to run this code: 我试图运行以下代码:

import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)

print "hhhh"
from scapy.all import send
from scapy.layers.inet import IP, UDP

send(IP()/UDP())
print "BBBB"

and I got this output error: 我得到这个输出错误:

hhhh
Traceback (most recent call last):
  File "C:/Users/Tamir/PycharmProjects/SIP/main.py", line 12, in <module>
    send(IP()/UDP())
  File "C:\Python27\lib\site-packages\scapy\sendrecv.py", line 251, in send
    __gen_send(conf.L3socket(*args, **kargs), x, inter=inter, loop=loop, count=count,verbose=verbose, realtime=realtime)
  File "C:\Python27\lib\site-packages\scapy\sendrecv.py", line 234, in __gen_send
    s.send(p)
  File "C:\Python27\lib\site-packages\scapy\arch\pcapdnet.py", line 252, in send
    ifs = dnet.ip()
  File "dnet.pyx", line 250, in dnet.ip.__init__ (./dnet.c:2317)
OSError: No such file or directory

But, other functions, such as sniff(), work fine. 但是,其他功能(例如sniff())也可以正常工作。

Does anyone know how to fix this? 有谁知道如何解决这一问题? I'm using windows 7 and python 2.7 我正在使用Windows 7和python 2.7

Scapy requires dnet library. Scapy需要dnet库。 It is required for sending packets. 发送数据包是必需的。 Sniffing and dissecting might work well without it. 没有它,嗅探和解剖可能会很好。

You can either remove importing dnet or install dnet library. 您可以删除导入的dnet或安装dnet库。

This is a similar question with a possible solution: Running Scapy on Windows with Python 2.7 这是一个可能的解决方案的类似问题: 在Windows上使用Python 2.7运行Scapy

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM