首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么pcapy不在我的Ubuntu18.04服务器上安装最新版本呢?

为什么pcapy不在我的Ubuntu18.04服务器上安装最新版本呢?
EN

Stack Overflow用户
提问于 2020-11-06 10:33:25
回答 1查看 673关注 0票数 1

我可以看到pcapy0.11.4上:

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

对我来说,我似乎无法得到更晚的版本:

代码语言:javascript
复制
pip install pcapy

pcapy (0.10.8)

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

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

代码语言:javascript
复制
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/
EN

回答 1

Stack Overflow用户

发布于 2020-11-06 10:41:40

一如既往-你最终找到答案后,张贴!所以我不得不:

代码语言:javascript
复制
apt-get -y install schedtool libpcap-dev
pip2 install pcapy

现在,它正确地安装了最新版本。好了!

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64712946

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档