如何为python3安装netfilterqueue?

编码学生

我正在使用python3.8作为我在pycharm中的解释器来做一个项目。

如何安装netfilterqueue,使其在python3中工作?我试图在我的kali终端中运行以下命令,但出现以下错误:

root@kali:~/PycharmProjects/dns_spoof# pip3 install netfilterqueue
Collecting netfilterqueue
  Cache entry deserialization failed, entry ignored
  Using cached https://files.pythonhosted.org/packages/39/c4/8f73f70442aa4094b3c37876c96cddad2c3e74c058f6cd9cb017d37ffac0/NetfilterQueue-0.8.1.tar.gz
Building wheels for collected packages: netfilterqueue
  Running setup.py bdist_wheel for netfilterqueue ... error
  Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-evvln_9d/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-z72tnt4e --python-tag cp37:
  running bdist_wheel
  running build
  running build_ext
  building 'netfilterqueue' extension
  creating build
  creating build/temp.linux-x86_64-3.7
  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.7m -c netfilterqueue.c -o build/temp.linux-x86_64-3.7/netfilterqueue.o
  netfilterqueue.c: In function ‘__pyx_f_14netfilterqueue_6Packet_set_nfq_data’:
  netfilterqueue.c:2150:68: warning: passing argument 2 of ‘nfq_get_payload’ from incompatible pointer type [-Wincompatible-pointer-types]
   2150 |   __pyx_v_self->payload_len = nfq_get_payload(__pyx_v_self->_nfa, (&__pyx_v_self->payload));
        |                                                                   ~^~~~~~~~~~~~~~~~~~~~~~~
        |                                                                    |
        |                                                                    char **
  In file included from netfilterqueue.c:440:
  /usr/include/libnetfilter_queue/libnetfilter_queue.h:122:67: note: expected ‘unsigned char **’ but argument is of type ‘char **’
    122 | extern int nfq_get_payload(struct nfq_data *nfad, unsigned char **data);
        |                                                   ~~~~~~~~~~~~~~~~^~~~
  netfilterqueue.c: In function ‘__pyx_pf_14netfilterqueue_6Packet_4get_hw’:
  netfilterqueue.c:2533:17: warning: implicit declaration of function ‘PyString_FromStringAndSize’; did you mean ‘PyBytes_FromStringAndSize’? [-Wimplicit-function-declaration]
   2533 |     __pyx_t_3 = PyString_FromStringAndSize(((char *)__pyx_v_self->hw_addr), 8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error)
        |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
        |                 PyBytes_FromStringAndSize
  netfilterqueue.c:2533:15: warning: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
   2533 |     __pyx_t_3 = PyString_FromStringAndSize(((char *)__pyx_v_self->hw_addr), 8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error)
        |               ^
  netfilterqueue.c: In function ‘__Pyx_PyCFunction_FastCall’:
  netfilterqueue.c:6436:13: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t))meth’
   6436 |     return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
        |            ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  netfilterqueue.c: In function ‘__Pyx__ExceptionSave’:
  netfilterqueue.c:7132:21: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
   7132 |     *type = tstate->exc_type;
        |                     ^~~~~~~~
        |                     curexc_type
  netfilterqueue.c:7133:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
   7133 |     *value = tstate->exc_value;
        |                      ^~~~~~~~~
        |                      curexc_value
  netfilterqueue.c:7134:19: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
   7134 |     *tb = tstate->exc_traceback;
        |                   ^~~~~~~~~~~~~
        |                   curexc_traceback
  netfilterqueue.c: In function ‘__Pyx__ExceptionReset’:
  netfilterqueue.c:7141:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
   7141 |     tmp_type = tstate->exc_type;
        |                        ^~~~~~~~
        |                        curexc_type
  netfilterqueue.c:7142:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
   7142 |     tmp_value = tstate->exc_value;
        |                         ^~~~~~~~~
        |                         curexc_value
  netfilterqueue.c:7143:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
   7143 |     tmp_tb = tstate->exc_traceback;
        |                      ^~~~~~~~~~~~~
        |                      curexc_traceback
  netfilterqueue.c:7144:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
   7144 |     tstate->exc_type = type;
        |             ^~~~~~~~
        |             curexc_type
  netfilterqueue.c:7145:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
   7145 |     tstate->exc_value = value;
        |             ^~~~~~~~~
        |             curexc_value
  netfilterqueue.c:7146:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
   7146 |     tstate->exc_traceback = tb;
        |             ^~~~~~~~~~~~~
        |             curexc_traceback
  netfilterqueue.c: In function ‘__Pyx__GetException’:
  netfilterqueue.c:7201:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
   7201 |     tmp_type = tstate->exc_type;
        |                        ^~~~~~~~
        |                        curexc_type
  netfilterqueue.c:7202:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
   7202 |     tmp_value = tstate->exc_value;
        |                         ^~~~~~~~~
        |                         curexc_value
  netfilterqueue.c:7203:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
   7203 |     tmp_tb = tstate->exc_traceback;
        |                      ^~~~~~~~~~~~~
        |                      curexc_traceback
  netfilterqueue.c:7204:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
   7204 |     tstate->exc_type = local_type;
        |             ^~~~~~~~
        |             curexc_type
  netfilterqueue.c:7205:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
   7205 |     tstate->exc_value = local_value;
        |             ^~~~~~~~~
        |             curexc_value
  netfilterqueue.c:7206:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
   7206 |     tstate->exc_traceback = local_tb;
        |             ^~~~~~~~~~~~~
        |             curexc_traceback
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for netfilterqueue
  Running setup.py clean for netfilterqueue
Failed to build netfilterqueue
Installing collected packages: netfilterqueue
  Running setup.py install for netfilterqueue ... error
    Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-evvln_9d/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-7hb6tfdl/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'netfilterqueue' extension
    creating build
    creating build/temp.linux-x86_64-3.7
    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.7m -c netfilterqueue.c -o build/temp.linux-x86_64-3.7/netfilterqueue.o
    netfilterqueue.c: In function ‘__pyx_f_14netfilterqueue_6Packet_set_nfq_data’:
    netfilterqueue.c:2150:68: warning: passing argument 2 of ‘nfq_get_payload’ from incompatible pointer type [-Wincompatible-pointer-types]
     2150 |   __pyx_v_self->payload_len = nfq_get_payload(__pyx_v_self->_nfa, (&__pyx_v_self->payload));
          |                                                                   ~^~~~~~~~~~~~~~~~~~~~~~~
          |                                                                    |
          |                                                                    char **
    In file included from netfilterqueue.c:440:
    /usr/include/libnetfilter_queue/libnetfilter_queue.h:122:67: note: expected ‘unsigned char **’ but argument is of type ‘char **’
      122 | extern int nfq_get_payload(struct nfq_data *nfad, unsigned char **data);
          |                                                   ~~~~~~~~~~~~~~~~^~~~
    netfilterqueue.c: In function ‘__pyx_pf_14netfilterqueue_6Packet_4get_hw’:
    netfilterqueue.c:2533:17: warning: implicit declaration of function ‘PyString_FromStringAndSize’; did you mean ‘PyBytes_FromStringAndSize’? [-Wimplicit-function-declaration]
     2533 |     __pyx_t_3 = PyString_FromStringAndSize(((char *)__pyx_v_self->hw_addr), 8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error)
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
          |                 PyBytes_FromStringAndSize
    netfilterqueue.c:2533:15: warning: assignment to ‘PyObject *’ {aka ‘struct _object *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
     2533 |     __pyx_t_3 = PyString_FromStringAndSize(((char *)__pyx_v_self->hw_addr), 8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error)
          |               ^
    netfilterqueue.c: In function ‘__Pyx_PyCFunction_FastCall’:
    netfilterqueue.c:6436:13: error: too many arguments to function ‘(PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t))meth’
     6436 |     return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
          |            ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    netfilterqueue.c: In function ‘__Pyx__ExceptionSave’:
    netfilterqueue.c:7132:21: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
     7132 |     *type = tstate->exc_type;
          |                     ^~~~~~~~
          |                     curexc_type
    netfilterqueue.c:7133:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
     7133 |     *value = tstate->exc_value;
          |                      ^~~~~~~~~
          |                      curexc_value
    netfilterqueue.c:7134:19: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     7134 |     *tb = tstate->exc_traceback;
          |                   ^~~~~~~~~~~~~
          |                   curexc_traceback
    netfilterqueue.c: In function ‘__Pyx__ExceptionReset’:
    netfilterqueue.c:7141:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
     7141 |     tmp_type = tstate->exc_type;
          |                        ^~~~~~~~
          |                        curexc_type
    netfilterqueue.c:7142:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
     7142 |     tmp_value = tstate->exc_value;
          |                         ^~~~~~~~~
          |                         curexc_value
    netfilterqueue.c:7143:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     7143 |     tmp_tb = tstate->exc_traceback;
          |                      ^~~~~~~~~~~~~
          |                      curexc_traceback
    netfilterqueue.c:7144:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
     7144 |     tstate->exc_type = type;
          |             ^~~~~~~~
          |             curexc_type
    netfilterqueue.c:7145:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
     7145 |     tstate->exc_value = value;
          |             ^~~~~~~~~
          |             curexc_value
    netfilterqueue.c:7146:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     7146 |     tstate->exc_traceback = tb;
          |             ^~~~~~~~~~~~~
          |             curexc_traceback
    netfilterqueue.c: In function ‘__Pyx__GetException’:
    netfilterqueue.c:7201:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
     7201 |     tmp_type = tstate->exc_type;
          |                        ^~~~~~~~
          |                        curexc_type
    netfilterqueue.c:7202:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
     7202 |     tmp_value = tstate->exc_value;
          |                         ^~~~~~~~~
          |                         curexc_value
    netfilterqueue.c:7203:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     7203 |     tmp_tb = tstate->exc_traceback;
          |                      ^~~~~~~~~~~~~
          |                      curexc_traceback
    netfilterqueue.c:7204:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
     7204 |     tstate->exc_type = local_type;
          |             ^~~~~~~~
          |             curexc_type
    netfilterqueue.c:7205:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
     7205 |     tstate->exc_value = local_value;
          |             ^~~~~~~~~
          |             curexc_value
    netfilterqueue.c:7206:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     7206 |     tstate->exc_traceback = local_tb;
          |             ^~~~~~~~~~~~~
          |             curexc_traceback
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-evvln_9d/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-7hb6tfdl/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-evvln_9d/netfilterqueue/

出现错误后,我尝试运行“ pip卸载netfilterqueue”和“ pip3卸载netfilterqueue”,然后再次运行“ pip3安装netfilterqueue”,但是仍然出现相同的错误。

我该如何解决?

拉法尔

看起来NetfilterQueue软件包不支持python 3.7+。他们没有在网站上提供此类信息,但是我尝试构建它,并且在3.7上编译时可以得到3.7的相同错误。

这是有道理的,因为发布了pip软件包:2017年1月31日和2018年的python3.7。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何为python3安装numpy

来自分类Dev

Ubuntu,如何为python3安装OpenCV?

来自分类Dev

如何为Anaconda python3安装gi模块?

来自分类Dev

如何为“ python3”安装“ requests”模块?

来自分类Dev

如何为Python安装GTK + 3

来自分类Dev

如何为Python安装GTK + 3

来自分类Dev

如何为Python 3安装nltk?

来自分类Dev

如何使用Python3安装PyRTF?

来自分类Dev

python3如何自动安装模块?

来自分类Dev

如何为Python 3.x安装psycopg2?

来自分类Dev

如何为Python 3.x安装psycopg2?

来自分类Dev

如何使用 pip 为 python3 安装 python 包?

来自分类Dev

如何安装和调用IDLE for Python3?

来自分类Dev

如何使用pip在Python3上安装Flask?

来自分类Dev

如何在Centos 7上正确安装python3

来自分类Dev

如何安装和调用IDLE for Python3?

来自分类Dev

Synology上的Python,如何安装Python3模块以及在哪里安装Python2.7?

来自分类Dev

如何为emacs配置python.el以使用python3 shell?

来自分类Dev

如何为emacs配置python.el以使用python3 shell?

来自分类Dev

如何为python3脚本创建deb包?

来自分类Dev

如何为python3脚本创建deb包?

来自分类Dev

如何使用安装在 Homebrew 中的 python3 版本而不是安装在库中的版本?

来自分类Dev

如何为Python 3.4安装sympy

来自分类Dev

如何为python 2.6安装pip?

来自分类常见问题

如何为Python 3.6安装PIL / Pillow?

来自分类Dev

如何为python安装子进程模块?

来自分类Dev

如何为python 2.7安装空闲

来自分类Dev

如何为Python 3.4安装sympy

来自分类Dev

如何为python安装opencv 2.9?