cffi.VerificationError:验证错误:命令“/usr/bin/gcc”失败,退出代码为1

xu3bshqb  于 11个月前  发布在  其他
关注(0)|答案(1)|浏览(130)

在使用命令pip install git+https://github.com/pewresearch/pewanalytics#egg=pewanalytics安装软件包pewanalytics时,我遇到以下错误:

× python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [130 lines of output]
      /tmp/pip-install-3oxpfcc8/ssdeep_b293003753c04cf9af66836870ebce44/setup.py:8: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
        from pkg_resources import parse_version
      /home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
      !!
      
              ********************************************************************************
              Requirements should be satisfied by a PEP 517 installer.
              If you are using pip, you can try `pip install --use-pep517`.
              ********************************************************************************
      
      !!
        dist.fetch_build_eggs(dist.setup_requires)
      running egg_info
      creating /tmp/pip-pip-egg-info-wmb6iul7/ssdeep.egg-info
      writing /tmp/pip-pip-egg-info-wmb6iul7/ssdeep.egg-info/PKG-INFO
      writing dependency_links to /tmp/pip-pip-egg-info-wmb6iul7/ssdeep.egg-info/dependency_links.txt
      writing requirements to /tmp/pip-pip-egg-info-wmb6iul7/ssdeep.egg-info/requires.txt
      writing top-level names to /tmp/pip-pip-egg-info-wmb6iul7/ssdeep.egg-info/top_level.txt
      writing manifest file '/tmp/pip-pip-egg-info-wmb6iul7/ssdeep.egg-info/SOURCES.txt'
      src/ssdeep/__pycache__/_ssdeep_cffi_a28e5628x27adcb8d.c:266:14: fatal error: fuzzy.h: No such file or directory
        266 |     #include "fuzzy.h"
            |              ^~~~~~~~~
      compilation terminated.
      Traceback (most recent call last):
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/unixccompiler.py", line 185, in _compile
          self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/ccompiler.py", line 1041, in spawn
          spawn(cmd, dry_run=self.dry_run, **kwargs)
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/spawn.py", line 70, in spawn
          raise DistutilsExecError(
      distutils.errors.DistutilsExecError: command '/usr/bin/gcc' failed with exit code 1
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/tmp/pip-install-3oxpfcc8/ssdeep_b293003753c04cf9af66836870ebce44/.eggs/cffi-1.16.0-py3.12-linux-x86_64.egg/cffi/ffiplatform.py", line 48, in _build
          dist.run_command('build_ext')
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/command/build_ext.py", line 88, in run
          _build_ext.run(self)
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
          self.build_extensions()
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
          self._build_extensions_serial()
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
          self.build_extension(ext)
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/command/build_ext.py", line 249, in build_extension
          _build_ext.build_extension(self, ext)
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 548, in build_extension
          objects = self.compiler.compile(
                    ^^^^^^^^^^^^^^^^^^^^^^
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/ccompiler.py", line 600, in compile
          self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/unixccompiler.py", line 187, in _compile
          raise CompileError(msg)
      distutils.errors.CompileError: command '/usr/bin/gcc' failed with exit code 1
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-3oxpfcc8/ssdeep_b293003753c04cf9af66836870ebce44/setup.py", line 108, in <module>
          setup(
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 321, in run
          self.find_sources()
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 329, in find_sources
          mm.run()
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 551, in run
          self.add_defaults()
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 589, in add_defaults
          sdist.add_defaults(self)
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/command/sdist.py", line 112, in add_defaults
          super().add_defaults()
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py", line 249, in add_defaults
          self._add_defaults_python()
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/command/sdist.py", line 123, in _add_defaults_python
          build_py = self.get_finalized_command('build_py')
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 305, in get_finalized_command
          cmd_obj.ensure_finalized()
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
          self.finalize_options()
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/command/build_py.py", line 39, in finalize_options
          orig.build_py.finalize_options(self)
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/command/build_py.py", line 46, in finalize_options
          self.set_undefined_options(
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 293, in set_undefined_options
          src_cmd_obj.ensure_finalized()
        File "/home/hafiz031/anaconda3/envs/rnd/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
          self.finalize_options()
        File "/tmp/pip-install-3oxpfcc8/ssdeep_b293003753c04cf9af66836870ebce44/setup.py", line 24, in finalize_options
          self.distribution.ext_modules = get_ext_modules()
                                          ^^^^^^^^^^^^^^^^^
        File "/tmp/pip-install-3oxpfcc8/ssdeep_b293003753c04cf9af66836870ebce44/setup.py", line 79, in get_ext_modules
          binding.verify()
        File "/tmp/pip-install-3oxpfcc8/ssdeep_b293003753c04cf9af66836870ebce44/src/ssdeep/binding.py", line 126, in verify
          self._lib = self.ffi.verify(
                      ^^^^^^^^^^^^^^^^
        File "/tmp/pip-install-3oxpfcc8/ssdeep_b293003753c04cf9af66836870ebce44/.eggs/cffi-1.16.0-py3.12-linux-x86_64.egg/cffi/api.py", line 468, in verify
          lib = self.verifier.load_library()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-install-3oxpfcc8/ssdeep_b293003753c04cf9af66836870ebce44/.eggs/cffi-1.16.0-py3.12-linux-x86_64.egg/cffi/verifier.py", line 105, in load_library
          self._compile_module()
        File "/tmp/pip-install-3oxpfcc8/ssdeep_b293003753c04cf9af66836870ebce44/.eggs/cffi-1.16.0-py3.12-linux-x86_64.egg/cffi/verifier.py", line 201, in _compile_module
          outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-install-3oxpfcc8/ssdeep_b293003753c04cf9af66836870ebce44/.eggs/cffi-1.16.0-py3.12-linux-x86_64.egg/cffi/ffiplatform.py", line 20, in compile
          outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-install-3oxpfcc8/ssdeep_b293003753c04cf9af66836870ebce44/.eggs/cffi-1.16.0-py3.12-linux-x86_64.egg/cffi/ffiplatform.py", line 54, in _build
          raise VerificationError('%s: %s' % (e.__class__.__name__, e))
      cffi.VerificationError: CompileError: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

字符串
如何解决这个问题?

e0uiprwp

e0uiprwp1#

好吧,安装以下软件包后,我再次尝试,发现问题得到了解决.以下是安装软件包的命令,可以解决这个问题:
安装libfuzzy的开发库。如果您使用的是基于Debian的系统:

sudo apt-get install libfuzzy-dev

字符串
对于基于Red-Hat的系统:

sudo dnf install ssdeep-devel


然后安装ssdeep

pip install ssdeep


再次尝试安装。

相关问题