我使用的是python版本2.7和Pycharm IDE,我通过pycharm UI安装了scapy模块(文件---默认设置 - 添加了scapy)
from scapy.all import DNS
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/apple/Library/Python/2.7/lib/python/site-packages/scapy/all.py", line 16, in <module>
from arch import *
File "/Users/apple/Library/Python/2.7/lib/python/site-packages/scapy/arch/__init__.py", line 76, in <module>
from bsd import *
File "/Users/apple/Library/Python/2.7/lib/python/site-packages/scapy/arch/bsd.py", line 12, in <module>
from unix import *
File "/Users/apple/Library/Python/2.7/lib/python/site-packages/scapy/arch/unix.py", line 20, in <module>
from pcapdnet import *
File "/Users/apple/Library/Python/2.7/lib/python/site-packages/scapy/arch/pcapdnet.py", line 173, in <module>
import dnet
ImportError: No module named dnet
当我在上面的语句中运行它显示上面的错误时,我成功安装了scapy模块......
答案 0 :(得分:0)
您必须安装libdnet
$ wget http://libdnet.googlecode.com/files/libdnet-1.12.tgz
$ tar xfz libdnet-1.12.tgz
$ ./configure
$ make
$ sudo make install
$ cd python
$ python2.5 setup.py install
对于64位....
$ CFLAGS='-arch i386 -arch x86_64' ./configure
$ archargs='-arch i386 -arch x86_64' make