简体   繁体   中英

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.

Does anyone know how to fix this? I'm using windows 7 and python 2.7

Scapy requires dnet library. It is required for sending packets. Sniffing and dissecting might work well without it.

You can either remove importing dnet or install dnet library.

This is a similar question with a possible solution: Running Scapy on Windows with Python 2.7

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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