无法使用 pip3 安装 pycares

时间:2021-04-11 05:53:04

标签: python python-3.x pip python-requests

我正在尝试使用命令安装 pycares

pip3 install pycares 

但是产生了以下巨大的错误。

我确定在安装 pycares 之前我可能需要安装一些其他工具,但我找不到任何可以解决该问题的在线资源。

我该怎么办?请帮忙。

ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-m54ctmbb/pycares/setup.py'"'"'; __file__='"'"'/tmp/pip-install-m54ctmbb/pycares/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-m54ctmbb/pycares/pip-egg-info
         cwd: /tmp/pip-install-m54ctmbb/pycares/
    Complete output (73 lines):
      ERROR: Command errored out with exit status 1:
       command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-bcfwodmf/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-bcfwodmf/cffi/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-btffk7ey
           cwd: /tmp/pip-wheel-bcfwodmf/cffi/
      Complete output (36 lines):
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-armv7l-3.8
      creating build/lib.linux-armv7l-3.8/cffi
      copying cffi/__init__.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/api.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/backend_ctypes.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/cffi_opcode.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/commontypes.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/cparser.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/error.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/ffiplatform.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/lock.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/model.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/pkgconfig.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/recompiler.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/setuptools_ext.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/vengine_cpy.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/vengine_gen.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/verifier.py -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/_cffi_include.h -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/parse_c_type.h -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/_embedding.h -> build/lib.linux-armv7l-3.8/cffi
      copying cffi/_cffi_errors.h -> build/lib.linux-armv7l-3.8/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-armv7l-3.8
      creating build/temp.linux-armv7l-3.8/c
      arm-linux-gnueabihf-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 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.8 -c c/_cffi_backend.c -o build/temp.linux-armv7l-3.8/c/_cffi_backend.o
      c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
         15 | #include <ffi.h>
            |          ^~~~~~~
      compilation terminated.
      error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
      ----------------------------------------
      ERROR: Failed building wheel for cffi
    ERROR: Failed to build one or more wheels
    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/setuptools/installer.py", line 128, in fetch_build_egg
        subprocess.check_call(cmd)
      File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpoy4cz1ne', '--quiet', 'cffi>=1.5.0']' returned non-zero exit status 1.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-m54ctmbb/pycares/setup.py", line 15, in <module>
        setup(name             = 'pycares',
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 143, in setup
        _install_setup_requires(attrs)
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 138, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 718, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 781, in resolve
        dist = best[req.key] = env.best_match(
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1066, in best_match
        return self.obtain(req, installer)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1078, in obtain
        return installer(requirement)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 777, in fetch_build_egg
        return fetch_build_egg(self, req)
      File "/usr/lib/python3/dist-packages/setuptools/installer.py", line 130, in fetch_build_egg
        raise DistutilsError(str(e))
    distutils.errors.DistutilsError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpoy4cz1ne', '--quiet', 'cffi>=1.5.0']' returned non-zero exit status 1.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我需要 pycares,因为我想在我的 ubuntu 机器上运行 theHarvester。 但是在我从 github git clone theHarvester 存储库并运行 pip install -r requirements.txt 命令之后,除了 pycares 再次生成了这个巨大的错误之外,每个库都被安装了。

1 个答案:

答案 0 :(得分:0)

您需要 Python 开发文件。

sudo apt install python3-dev