0

我可以在这里看到pcapy0.11.4

https://pypi.org/project/pcapy/

对我来说,我似乎无法获得更高版本:

pip install pcapy

pcapy (0.10.8)

如何获取最新信息?0.10.8 似乎有内存泄漏,虽然它在我的大型服务器上并不是什么大问题,但它会在较小的服务器上引起问题,因为它只有 4gb 用于整个服务器。这被用作 Maltrail BTW 的依赖项

编辑:当我尝试进行升级时,我得到:

root@ca1:/etc/fail2ban# pip install --upgrade pcapy
Collecting pcapy
  Using cached https://files.pythonhosted.org/packages/b0/68/b49e008f9e2b5ab727fb4b820c2e7d0914bd8dacb3c2d668a36b6e5d8991/pcapy-0.11.4.tar.gz
Building wheels for collected packages: pcapy
  Running setup.py bdist_wheel for pcapy ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-jcvFms/pcapy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmptGvI9qpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_ext
  building 'pcapy' extension
  creating build
  creating build/temp.linux-x86_64-2.7
  x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-UKCoZ3/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c pcapdumper.cc -o build/temp.linux-x86_64-2.7/pcapdumper.o
  pcapdumper.cc:11:10: fatal error: pcap.h: No such file or directory
   #include <pcap.h>
            ^~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for pcapy
  Running setup.py clean for pcapy
Failed to build pcapy
Installing collected packages: pcapy
  Found existing installation: pcapy 0.10.8
    Not uninstalling pcapy at /usr/lib/python2.7/dist-packages, outside environment /usr
  Running setup.py install for pcapy ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-jcvFms/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-qPqZSL-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-2.7
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-UKCoZ3/python2.7-2.7.17=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c pcapdumper.cc -o build/temp.linux-x86_64-2.7/pcapdumper.o
    pcapdumper.cc:11:10: fatal error: pcap.h: No such file or directory
     #include <pcap.h>
              ^~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
  Can't rollback pcapy, nothing uninstalled.
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-jcvFms/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-qPqZSL-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-jcvFms/pcapy/
4

1 回答 1

0

与往常一样 - 您最终会在发布后找到答案!所以我不得不这样做:

apt-get -y install schedtool libpcap-dev
pip2 install pcapy

现在它正确安装了最新版本。呸!

于 2020-11-06T10:41:40.143 回答