DinoTools / python-ssdeep

Python wrapper for ssdeep fuzzy hashing library
GNU Lesser General Public License v3.0
152 stars 30 forks source link

setuptools/wheel.py: FileExistsError: [Errno 17] File exists: '/private/var/folders/.../.eggs/cffi.egg' #65

Closed vadimszzz closed 1 year ago

vadimszzz commented 1 year ago
ISSUE TYPE
OS / ENVIRONMENT

OS:

Python version:

ssdeep lib:

% brew install ssdeep
SUMMARY
% pip install ssdeep

Collecting ssdeep
  Using cached ssdeep-3.4.tar.gz (110 kB)
  Preparing metadata (setup.py) ... done
Collecting cffi>=0.8.6
  Using cached cffi-1.15.1-cp38-cp38-macosx_10_9_x86_64.whl (178 kB)
Collecting six>=1.4.1
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Building wheels for collected packages: ssdeep
  Building wheel for ssdeep (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [28 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-install-gym6_b8v/ssdeep_7f62328501924feca4821cf3893fbfe3/setup.py", line 108, in <module>
          setup(
        File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 164, in setup
          _install_setup_requires(attrs)
        File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires
          dist.fetch_build_eggs(dist.setup_requires)
        File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 779, in resolve
          dist = best[req.key] = env.best_match(
        File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1064, in best_match
          return self.obtain(req, installer)
        File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1076, in obtain
          return installer(requirement)
        File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 758, in fetch_build_egg
          return fetch_build_egg(self, req)
        File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/installer.py", line 133, in fetch_build_egg
          wheel.install_as_egg(dist_location)
        File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 99, in install_as_egg
          self._install_as_egg(destination_eggdir, zf)
        File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 107, in _install_as_egg
          self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
        File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 128, in _convert_metadata
          os.mkdir(destination_eggdir)
      FileExistsError: [Errno 17] File exists: '/private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-install-gym6_b8v/ssdeep_7f62328501924feca4821cf3893fbfe3/.eggs/cffi-1.15.1-py3.8-macosx-10.14-x86_64.egg'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for ssdeep
welcome[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the issue template!

vadimszzz commented 1 year ago
% /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3 -m pip install setuptools wheel pip --upgrade 
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: setuptools in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages (49.2.1)
Collecting setuptools
  Using cached setuptools-65.6.3-py3-none-any.whl (1.2 MB)
Requirement already satisfied: wheel in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages (0.36.2)
Collecting wheel
  Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
Requirement already satisfied: pip in /Users/dflbv/Library/Python/3.8/lib/python/site-packages (22.1.2)
Collecting pip
  Using cached pip-22.3.1-py3-none-any.whl (2.1 MB)
Installing collected packages: wheel, setuptools, pip
  WARNING: The script wheel is installed in '/Users/dflbv/Library/Python/3.8/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  Attempting uninstall: pip
    Found existing installation: pip 22.1.2
    Uninstalling pip-22.1.2:
      Successfully uninstalled pip-22.1.2
  WARNING: The scripts pip, pip3, pip3.10 and pip3.8 are installed in '/Users/dflbv/Library/Python/3.8/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-22.3.1 setuptools-65.6.3 wheel-0.38.4

% /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3 -m pip install ssdeep          
Collecting ssdeep
  Using cached ssdeep-3.4.tar.gz (110 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [111 lines of output]
      running egg_info
      creating /private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-pip-egg-info-fubeh4qf/ssdeep.egg-info
      writing /private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-pip-egg-info-fubeh4qf/ssdeep.egg-info/PKG-INFO
      writing dependency_links to /private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-pip-egg-info-fubeh4qf/ssdeep.egg-info/dependency_links.txt
      writing requirements to /private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-pip-egg-info-fubeh4qf/ssdeep.egg-info/requires.txt
      writing top-level names to /private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-pip-egg-info-fubeh4qf/ssdeep.egg-info/top_level.txt
      writing manifest file '/private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-pip-egg-info-fubeh4qf/ssdeep.egg-info/SOURCES.txt'
      src/ssdeep/__pycache__/_ssdeep_cffi_a28e5628x27adcb8d.c:2:10: fatal error: 'Python.h' file not found
      #include <Python.h>
               ^~~~~~~~~~
      1 error generated.
      /Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
        warnings.warn(
      Traceback (most recent call last):
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/unixccompiler.py", line 186, in _compile
          self.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/ccompiler.py", line 1007, in spawn
          spawn(cmd, dry_run=self.dry_run, **kwargs)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/spawn.py", line 70, in spawn
          raise DistutilsExecError(
      distutils.errors.DistutilsExecError: command '/usr/local/opt/llvm/bin/clang' failed with exit code 1

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-install-jg5zc5ah/ssdeep_dd4a1d0472e34f0698dddacb6a9c0c93/.eggs/cffi-1.15.1-py3.8-macosx-10.14-x86_64.egg/cffi/ffiplatform.py", line 51, in _build
          dist.run_command('build_ext')
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/command/build_ext.py", line 84, in run
          _build_ext.run(self)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
          self.build_extensions()
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/command/build_ext.py", line 468, in build_extensions
          self._build_extensions_serial()
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/command/build_ext.py", line 494, in _build_extensions_serial
          self.build_extension(ext)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/command/build_ext.py", line 246, in build_extension
          _build_ext.build_extension(self, ext)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/command/build_ext.py", line 549, in build_extension
          objects = self.compiler.compile(
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/ccompiler.py", line 599, in compile
          self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/unixccompiler.py", line 188, in _compile
          raise CompileError(msg)
      distutils.errors.CompileError: command '/usr/local/opt/llvm/bin/clang' 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 "/private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-install-jg5zc5ah/ssdeep_dd4a1d0472e34f0698dddacb6a9c0c93/setup.py", line 108, in <module>
          setup(
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/__init__.py", line 87, in setup
          return distutils.core.setup(**attrs)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/dist.py", line 1208, in run_command
          super().run_command(command)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/command/egg_info.py", line 308, in run
          self.find_sources()
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/command/egg_info.py", line 316, in find_sources
          mm.run()
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/command/egg_info.py", line 560, in run
          self.add_defaults()
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/command/egg_info.py", line 597, in add_defaults
          sdist.add_defaults(self)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/command/sdist.py", line 106, in add_defaults
          super().add_defaults()
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/command/sdist.py", line 250, in add_defaults
          self._add_defaults_python()
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/command/sdist.py", line 117, in _add_defaults_python
          build_py = self.get_finalized_command('build_py')
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/cmd.py", line 305, in get_finalized_command
          cmd_obj.ensure_finalized()
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
          self.finalize_options()
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/command/build_py.py", line 37, in finalize_options
          orig.build_py.finalize_options(self)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/command/build_py.py", line 47, in finalize_options
          self.set_undefined_options(
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/cmd.py", line 293, in set_undefined_options
          src_cmd_obj.ensure_finalized()
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
          self.finalize_options()
        File "/private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-install-jg5zc5ah/ssdeep_dd4a1d0472e34f0698dddacb6a9c0c93/setup.py", line 24, in finalize_options
          self.distribution.ext_modules = get_ext_modules()
        File "/private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-install-jg5zc5ah/ssdeep_dd4a1d0472e34f0698dddacb6a9c0c93/setup.py", line 79, in get_ext_modules
          binding.verify()
        File "/private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-install-jg5zc5ah/ssdeep_dd4a1d0472e34f0698dddacb6a9c0c93/src/ssdeep/binding.py", line 126, in verify
          self._lib = self.ffi.verify(
        File "/private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-install-jg5zc5ah/ssdeep_dd4a1d0472e34f0698dddacb6a9c0c93/.eggs/cffi-1.15.1-py3.8-macosx-10.14-x86_64.egg/cffi/api.py", line 468, in verify
          lib = self.verifier.load_library()
        File "/private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-install-jg5zc5ah/ssdeep_dd4a1d0472e34f0698dddacb6a9c0c93/.eggs/cffi-1.15.1-py3.8-macosx-10.14-x86_64.egg/cffi/verifier.py", line 105, in load_library
          self._compile_module()
        File "/private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-install-jg5zc5ah/ssdeep_dd4a1d0472e34f0698dddacb6a9c0c93/.eggs/cffi-1.15.1-py3.8-macosx-10.14-x86_64.egg/cffi/verifier.py", line 202, in _compile_module
          outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
        File "/private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-install-jg5zc5ah/ssdeep_dd4a1d0472e34f0698dddacb6a9c0c93/.eggs/cffi-1.15.1-py3.8-macosx-10.14-x86_64.egg/cffi/ffiplatform.py", line 22, in compile
          outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
        File "/private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-install-jg5zc5ah/ssdeep_dd4a1d0472e34f0698dddacb6a9c0c93/.eggs/cffi-1.15.1-py3.8-macosx-10.14-x86_64.egg/cffi/ffiplatform.py", line 58, in _build
          raise VerificationError('%s: %s' % (e.__class__.__name__, e))
      cffi.VerificationError: CompileError: command '/usr/local/opt/llvm/bin/clang' 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.

% ls /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/
Headers     Python3     Resources   _CodeSignature  bin     include     lib     share

% export CPPFLAGS="-I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 $CPPFLAGS"

% echo $CPPFLAGS
-I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -I/usr/local/include

% /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3 -m pip install ssdeep
Collecting ssdeep
  Using cached ssdeep-3.4.tar.gz (110 kB)
  Preparing metadata (setup.py) ... done
Collecting cffi>=0.8.6
  Using cached cffi-1.15.1-cp38-cp38-macosx_10_9_x86_64.whl (178 kB)
Collecting six>=1.4.1
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Building wheels for collected packages: ssdeep
  Building wheel for ssdeep (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [30 lines of output]
      /Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
        warnings.warn(
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-install-ln459ni1/ssdeep_5ff261cb4e9644f79288803ba1d27ae6/setup.py", line 108, in <module>
          setup(
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/__init__.py", line 86, in setup
          _install_setup_requires(attrs)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/__init__.py", line 80, in _install_setup_requires
          dist.fetch_build_eggs(dist.setup_requires)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/dist.py", line 874, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/pkg_resources/__init__.py", line 789, in resolve
          dist = best[req.key] = env.best_match(
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/pkg_resources/__init__.py", line 1075, in best_match
          return self.obtain(req, installer)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/pkg_resources/__init__.py", line 1087, in obtain
          return installer(requirement)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/dist.py", line 944, in fetch_build_egg
          return fetch_build_egg(self, req)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/installer.py", line 87, in fetch_build_egg
          wheel.install_as_egg(dist_location)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/wheel.py", line 110, in install_as_egg
          self._install_as_egg(destination_eggdir, zf)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/wheel.py", line 118, in _install_as_egg
          self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
        File "/Users/dflbv/Library/Python/3.8/lib/python/site-packages/setuptools/wheel.py", line 162, in _convert_metadata
          os.rename(dist_info, egg_info)
      OSError: [Errno 66] Directory not empty: '/private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-install-ln459ni1/ssdeep_5ff261cb4e9644f79288803ba1d27ae6/.eggs/cffi-1.15.1-py3.8-macosx-10.14-x86_64.egg/cffi-1.15.1.dist-info' -> '/private/var/folders/lx/hlw2jxk93gn8vkjr3rkczpl80000gn/T/pip-install-ln459ni1/ssdeep_5ff261cb4e9644f79288803ba1d27ae6/.eggs/cffi-1.15.1-py3.8-macosx-10.14-x86_64.egg/EGG-INFO'
      [end of output]
vadimszzz commented 1 year ago

pip install ez_setup fixed the issue