0
root@kali:/home/kali/Desktop# pip install NetfilterQueue
Collecting NetfilterQueue
  Using cached NetfilterQueue-0.8.1.tar.gz (58 kB)
Building wheels for collected packages: NetfilterQueue
  Building wheel for NetfilterQueue (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6ltnc7gf/netfilterqueue/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6ltnc7gf/netfilterqueue/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/pip-wheel-v0vd42ah                                                                                           
       cwd: /tmp/pip-install-6ltnc7gf/netfilterqueue/                                                                         
  Complete output (13 lines):                                                                                                 
  running bdist_wheel                                                                                                         
  running build                                                                                                               
  running build_ext                                                                                                           
  skipping 'netfilterqueue.c' Cython extension (up-to-date)                                                                   
  building 'netfilterqueue' extension                                                                                         
  creating build                                                                                                              
  creating build/temp.linux-x86_64-3.8                                                                                        
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c netfilterqueue.c -o build/temp.linux-x86_64-3.8/netfilterqueue.o               
  netfilterqueue.c:437:10: fatal error: libnfnetlink/linux_nfnetlink.h: No such file or directory                             
    437 | #include "libnfnetlink/linux_nfnetlink.h"                                                                           
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                           
  compilation terminated.                                                                                                     
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1                                                             
  ----------------------------------------                                                                                    
  ERROR: Failed building wheel for NetfilterQueue
  Running setup.py clean for NetfilterQueue
Failed to build NetfilterQueue
DEPRECATION: Could not build wheels for NetfilterQueue which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.                                
Installing collected packages: NetfilterQueue
    Running setup.py install for NetfilterQueue ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6ltnc7gf/netfilterqueue/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6ltnc7gf/netfilterqueue/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-record-qodwn5k_/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/NetfilterQueue                                                                                     
         cwd: /tmp/pip-install-6ltnc7gf/netfilterqueue/                                                                       
    Complete output (13 lines):                                                                                               
    running install                                                                                                           
    running build                                                                                                             
    running build_ext                                                                                                         
    skipping 'netfilterqueue.c' Cython extension (up-to-date)                                                                 
    building 'netfilterqueue' extension                                                                                       
    creating build                                                                                                            
    creating build/temp.linux-x86_64-3.8                                                                                      
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c netfilterqueue.c -o build/temp.linux-x86_64-3.8/netfilterqueue.o             
    netfilterqueue.c:437:10: fatal error: libnfnetlink/linux_nfnetlink.h: No such file or directory                           
      437 | #include "libnfnetlink/linux_nfnetlink.h"                                                                         
          |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                         
    compilation terminated.                                                                                                   
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1                                                           
    ----------------------------------------                                                                                  
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6ltnc7gf/netfilterqueue/setup.py'"'"'; __file__='"'"'/tmp/pip-install-6ltnc7gf/netfilterqueue/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-record-qodwn5k_/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/NetfilterQueue Check the logs for full command output.

我试过 apt-get install build-essential python3-dev libnetfilter-queue-dev 但后来我得到了

root@kali:/home/kali/Desktop# apt-get install build-essential python3-dev libnetfilter-queue-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libnetfilter-queue-dev

我正在尝试为 python3 安装 netfilterqueue 库,但我无法安装 netfilter 队列,有什么帮助吗?我尝试安装 livnetfilter queue 但它也不起作用,我在网上搜索并找不到任何东西。有什么问题

4

3 回答 3

0

你好首先在你的linux机器上安装netfilterqueue

sudo apt install libnfnetlink-dev libnetfilter-queue-dev

那么你应该知道 python3+ 的 netfilterqueue 被命名为 nfqp3 所以安装它

pip3 install nfqp3

值得一提的是,在 python 脚本中导入它时,您应该将其导入为 netfilterqueue 而不是 nfqp3

于 2021-04-16T23:05:07.097 回答
0

在这方面研究了很多,我发现scapy在python-python2中不好用,netfilterqueue在python3中不好用,不降级语言我可以做到这一点,我建议你更正任何额外的错误,执行<< dpkg - configure -a >> 然后<< apt-get update >>,因为这个版本是无人值守的,并且可以在你的仓库列表中生成损坏的包

apt install python3-pip git libnfnetlink-dev libnetfilter-queue-dev

pip3 install -U git+https://github.com/kti/python-netfilterqueue

于 2020-09-25T08:45:16.530 回答
0

从源安装:

$ git clone git@github.com:kti/python-netfilterqueue.git
cd python-netfilterqueue
python setup.py install
于 2021-06-22T02:27:01.107 回答