之前为了工作需要,在自己的win上安装了pcapy,觉得配置好麻烦,后来试了一下centos下的安装,觉得清爽好多,觉得pcapy还是在centos下用比较好。
安装过程:
注意:我用的是centos7,centos6可能有些不同
1、依赖安装:
- A Python interpreter. Versions 2.1.3 and higher.
- A C++ compiler. GCC G++ 2.95, as well as Microsoft Visual Studio 6.0 or MSVC 2003 depending on the Python version.
- A Libpcap 0.9.3 or newer. Windows users should have installed WinPcap 4.0 or newer.
上面的依赖用yum安装就行:
yum install python(一般系统自带)
yum install python-devel
yum install gcc
yum install libpcap
然后下载pcapy 到python目录下的 site-packages:
http://www.coresecurity.com/system/files/pcapy-0.10.6.zip
unzip 解压
然后运行里面的setup.py :python setup.py install
然后python import就好了
比win简单多了