安装satori 时需要安装pcapy
一开始是以为gcc 有问题,注意看提示是没有
python.h 没有头文件,编译不通过
yum install libpcap-devel
yum install python3-devel py3 开发包。记得是要装py3 .python-devel 装的是2。7的版本。
原始报错信息:
[root@localhost satori-master]# pip3 install pcapy
WARNING: Running pip install with root privileges is generally not a good idea. Try pip3 install --user
instead.
Collecting pcapy
Downloading http://pypi.doubanio.com/packages/b0/68/b49e008f9e2b5ab727fb4b820c2e7d0914bd8dacb3c2d668a36b6e5d8991/pcapy-0.11.4.tar.gz
Installing collected packages: pcapy
Running setup.py install for pcapy … error
Complete output from command /usr/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-build-fv72a78n/pcapy/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-3n6ogg3_-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building ‘pcapy’ extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c pcapdumper.cc -o build/temp.linux-x86_64-3.6/pcapdumper.o
pcapdumper.cc:10:20: 致命错误:Python.h:没有那个文件或目录
#include <Python.h>
^
编译中断。
error: command ‘gcc’ failed with exit status 1
Command “/usr/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-build-fv72a78n/pcapy/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-3n6ogg3_-record/install-record.txt --single-version-externally-managed --compile” failed with error code 1 in /tmp/pip-build-fv72a78n/pcapy/
成功:
[root@localhost satori-master]# pip3 install pcapy
WARNING: Running pip install with root privileges is generally not a good idea. Try pip3 install --user
instead.
Collecting pcapy
Downloading http://pypi.doubanio.com/packages/b0/68/b49e008f9e2b5ab727fb4b820c2e7d0914bd8dacb3c2d668a36b6e5d8991/pcapy-0.11.4.tar.gz
Installing collected packages: pcapy
Running setup.py install for pcapy … done
Successfully installed pcapy-0.11.4