OpenMined / TenSEAL

A library for doing homomorphic encryption operations on tensors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation fails on macOS due to CMake error

aakrsht opened this issue · comments

Description

When attempting to install TenSEAL on macOS, the installation process fails. The error is consistent regardless of whether I try to install TenSEAL using 'pip install tenseal' or from the source directory with 'pip install .'. Despite CMake and Xcode being installed, the subprocess seems to encounter an issue when invoking it.

Using The first install method:

pip install tenseal
ERROR: Could not find a version that satisfies the requirement tenseal (from versions: none)
ERROR: No matching distribution found for tenseal

Using the other method:

aakrsht@Aakarshits-MacBook-Pro TenSEAL % pip install .
Processing /Users/aakrsht/TenSEAL
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: tenseal
  Building wheel for tenseal (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for tenseal (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [82 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-universal2-cpython-311
      creating build/lib.macosx-10.9-universal2-cpython-311/tenseal
      copying tenseal/version.py -> build/lib.macosx-10.9-universal2-cpython-311/tenseal
      copying tenseal/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/tenseal
      copying tenseal/enc_context.py -> build/lib.macosx-10.9-universal2-cpython-311/tenseal
      creating build/lib.macosx-10.9-universal2-cpython-311/tenseal/tensors
      copying tenseal/tensors/bfvvector.py -> build/lib.macosx-10.9-universal2-cpython-311/tenseal/tensors
      copying tenseal/tensors/plaintensor.py -> build/lib.macosx-10.9-universal2-cpython-311/tenseal/tensors
      copying tenseal/tensors/ckkstensor.py -> build/lib.macosx-10.9-universal2-cpython-311/tenseal/tensors
      copying tenseal/tensors/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/tenseal/tensors
      copying tenseal/tensors/bfvtensor.py -> build/lib.macosx-10.9-universal2-cpython-311/tenseal/tensors
      copying tenseal/tensors/abstract_tensor.py -> build/lib.macosx-10.9-universal2-cpython-311/tenseal/tensors
      copying tenseal/tensors/ckksvector.py -> build/lib.macosx-10.9-universal2-cpython-311/tenseal/tensors
      creating build/lib.macosx-10.9-universal2-cpython-311/tenseal/sealapi
      copying tenseal/sealapi/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/tenseal/sealapi
      creating build/lib.macosx-10.9-universal2-cpython-311/tenseal/sealapi/util
      copying tenseal/sealapi/util/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/tenseal/sealapi/util
      running build_ext
      Traceback (most recent call last):
        File "/Library/Frameworks/Python.framework/Versions/3.11/bin/cmake", line 5, in <module>
          from cmake import cmake
      ModuleNotFoundError: No module named 'cmake'
      Traceback (most recent call last):
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 434, in build_wheel
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 419, in _build_with_temp_dir
          self.run_setup()
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 507, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 81, in <module>
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 989, in run_command
          super().run_command(command)
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 369, in run
          self.run_command("build")
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 989, in run_command
          super().run_command(command)
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 989, in run_command
          super().run_command(command)
        File "/private/var/folders/mw/32v50z_52553m72drbjz33vh0000gn/T/pip-build-env-ylm_5esz/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 33, in run
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 466, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['cmake', '--version']' returned non-zero exit status 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for tenseal
Failed to build tenseal
ERROR: Could not build wheels for tenseal, which is required to install pyproject.toml-based projects

System Information

  • OS: macOS
  • OS Version: Sonoma 14.0
  • cmake version: 3.27.7

Additional Context

I have already tried uninstalling and reinstalling CMake, but the issue persists.

You can try to install tenseal by using:
pip install git+https://github.com/OpenMined/TenSEAL.git#egg=tenseal
The process is slow.