libdnetlibdnet
This is the code fragment that generates the exception.
from ctypes import *
from ctypes.util import find_library
_lib_name = find_library('dnet')
if not _lib_name:
raise OSError("Cannot find libdnet.so")
_lib=CDLL(_lib_name)
Apparently, python ctypes cannot find dnet library on your computer. Once you can get ctypes find dnet, it should work with scapy.
Also, usage of dnet is not mandatory. Try scapy with dnet disabled. You do not need it for parsing packets. And depending on the system, for some limited sending scapy can use pcap, too.
Please, file an issue on https://github.com/phaethon/scapy
From python doc: On OS X, find_library() tries several predefined naming schemes and paths to locate the library... Unfortunately I dont have OS X to tell you how to install dnet. Can you find libdnet.so on your hard drive? And copy it to some good location /usr/local/lib or /usr/lib? After you get OSError, can you still use scapy functionality (except for sending/receiving packets)?–Eriks DobelisJun 30 '15 at 6:31
It seems that it is currently at /Library/Python/2.7/site-packages/dnet.so. Ive tried copying it to the 3.4 library location, as well as /usr/local/lib, and ctypes still cannot find it. I cannot use any scapy functionality after the OSError.–MalikariJun 30 '15 at 14:08
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-35100-1.html
#舞蹈担当易烊千玺#