LaRiffle / shaloop

C optimization to run sha256/512 over numpy arrays
3 stars 2 forks source link

Failed to build Shaloop wheel #5

Open AbhishekPokala opened 4 years ago

AbhishekPokala commented 4 years ago

Question

Trying to install PySyft in Raspberry Pi 4 (32bit, armv7l, Ubuntu). I've installed torch(1.4.0a0+f43194e) with THIS WHEEL and torchvision(0.5.0a0+8cdc814) with THIS WHEEL.

I installed PySyft using: python3.7 -m pip install syft==0.2.4 --no-deps

When I try to import syft, I get the following error:

import syft

Traceback (most recent call last): File "", line 1, in File "/home/PySyftBuildFolder/PySyft/syft/init.py", line 40, in from syft.frameworks.torch.hook.hook import TorchHook # noqa: E402,F401 File "/home/PySyftBuildFolder/PySyft/syft/frameworks/torch/hook/hook.py", line 18, in from syft.frameworks.torch.tensors.interpreters.precision import FixedPrecisionTensor File "/home/PySyftBuildFolder/PySyft/syft/frameworks/torch/tensors/interpreters/precision.py", line 5, in from syft.frameworks.torch.nn import nn File "/home/PySyftBuildFolder/PySyft/syft/frameworks/torch/nn/init.py", line 10, in from syft.frameworks.torch.nn.rnn import GRU File "/home/PySyftBuildFolder/PySyft/syft/frameworks/torch/nn/rnn.py", line 7, in from syft.frameworks.torch.tensors.interpreters.additive_shared import AdditiveSharingTensor File "/home/PySyftBuildFolder/PySyft/syft/frameworks/torch/tensors/interpreters/additive_shared.py", line 7, in from syft.frameworks.torch.mpc import spdz File "/home/PySyftBuildFolder/PySyft/syft/frameworks/torch/mpc/spdz.py", line 11, in from syft.frameworks.torch.mpc.fss import N_CORES File "/home/PySyftBuildFolder/PySyft/syft/frameworks/torch/mpc/fss.py", line 14, in import shaloop ModuleNotFoundError: No module named 'shaloop'

System Information

Additional Context

This is the error when I try to manually install shaloop

python3.7 -m pip install shaloop

Defaulting to user installation because normal site-packages is not writeable Collecting shaloop Using cached shaloop-0.2.1_alpha.7.tar.gz (15.1 MB) Installing build dependencies ... error ERROR: Command errored out with exit status 1: command: /usr/local/bin/python3.7 /usr/local/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-i3gd086j/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- maturin cwd: None Complete output (57 lines): Collecting maturin Using cached maturin-0.8.3.tar.gz (82 kB) Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing wheel metadata: started Preparing wheel metadata: finished with status 'done' Collecting toml~=0.10.0 Using cached toml-0.10.1-py2.py3-none-any.whl (19 kB) Building wheels for collected packages: maturin Building wheel for maturin (PEP 517): started Building wheel for maturin (PEP 517): finished with status 'error' ERROR: Command errored out with exit status 1: command: /usr/local/bin/python3.7 /usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpscuzwsh1 cwd: /tmp/pip-install-i5bsnoy0/maturin Complete output (36 lines): running bdist_wheel running build installing to build/bdist.linux-armv7l/wheel running install Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in main() File "/usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main json_out['return_val'] = hook(hook_input['kwargs']) File "/usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 205, in build_wheel metadata_directory) File "/tmp/pip-build-env-0wq0cx83/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 209, in build_wheel wheel_directory, config_settings) File "/tmp/pip-build-env-0wq0cx83/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 194, in _build_with_temp_dir self.run_setup() File "/tmp/pip-build-env-0wq0cx83/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 142, in run_setup exec(compile(code, file, 'exec'), locals()) File "setup.py", line 101, in zip_safe=False, File "/tmp/pip-build-env-0wq0cx83/overlay/lib/python3.7/site-packages/setuptools/init.py", line 145, in setup return distutils.core.setup(attrs) File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/tmp/pip-build-env-0wq0cx83/overlay/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 228, in run self.run_command('install') File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "setup.py", line 55, in run "cargo not found in PATH. Please install rust " RuntimeError: cargo not found in PATH. Please install rust (https://www.rust-lang.org/tools/install) and try again ERROR: Failed building wheel for maturin Failed to build maturin ERROR: Could not build wheels for maturin which use PEP 517 and cannot be installed directly ERROR: Command errored out with exit status 1: /usr/local/bin/python3.7 /usr/local/lib/python3.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-i3gd086j/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- maturin Check the logs for full command output.

And when I try to manually install maturin python3.7 -m pip install maturin

Defaulting to user installation because normal site-packages is not writeable Collecting maturin Using cached maturin-0.8.3.tar.gz (82 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing wheel metadata ... done Collecting toml~=0.10.0 Using cached toml-0.10.1-py2.py3-none-any.whl (19 kB) Building wheels for collected packages: maturin Building wheel for maturin (PEP 517) ... error ERROR: Command errored out with exit status 1: command: /usr/local/bin/python3.7 /usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpf9hbrywp cwd: /tmp/pip-install-c7a0yw_j/maturin Complete output (36 lines): running bdist_wheel running build installing to build/bdist.linux-armv7l/wheel running install Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in main() File "/usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main json_out['return_val'] = hook(hook_input['kwargs']) File "/usr/local/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py", line 205, in build_wheel metadata_directory) File "/tmp/pip-build-env-r_fmi6tv/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 209, in build_wheel wheel_directory, config_settings) File "/tmp/pip-build-env-r_fmi6tv/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 194, in _build_with_temp_dir self.run_setup() File "/tmp/pip-build-env-r_fmi6tv/overlay/lib/python3.7/site-packages/setuptools/build_meta.py", line 142, in run_setup exec(compile(code, file, 'exec'), locals()) File "setup.py", line 101, in zip_safe=False, File "/tmp/pip-build-env-r_fmi6tv/overlay/lib/python3.7/site-packages/setuptools/init.py", line 145, in setup return distutils.core.setup(attrs) File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/tmp/pip-build-env-r_fmi6tv/overlay/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 228, in run self.run_command('install') File "/usr/local/lib/python3.7/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command cmd_obj.run() File "setup.py", line 55, in run "cargo not found in PATH. Please install rust " RuntimeError: cargo not found in PATH. Please install rust (https://www.rust-lang.org/tools/install) and try again ERROR: Failed building wheel for maturin Failed to build maturin ERROR: Could not build wheels for maturin which use PEP 517 and cannot be installed directly

patselle commented 3 years ago

Hi @AbhishekPokala

try to install cargo apt install cargo

I also get an error when I try to install shaloop via pip:

python3 -m pip install shaloop
Collecting shaloop
  Downloading shaloop-0.2.1_alpha.7.tar.gz (15.1 MB)
     |████████████████████████████████| 15.1 MB 5.4 MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Requirement already satisfied: pycparser>=2 in /usr/local/lib/python3.6/dist-packages (from shaloop) (2.20)
Requirement already satisfied: numpy>=1 in /usr/local/lib/python3.6/dist-packages (from shaloop) (1.16.1)
Requirement already satisfied: cffi>=1 in /usr/local/lib/python3.6/dist-packages (from shaloop) (1.14.3)
Building wheels for collected packages: shaloop
  Building wheel for shaloop (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/local/lib/python3.6/dist-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpdq1g_2y8
       cwd: /tmp/pip-install-_fo_dmgk/shaloop
  Complete output (6 lines):
  💥 maturin failed
    Caused by: Failed to find python interpreter for generating cffi bindings
    Caused by: Failed to get information from the python interpreter at python
    Caused by: Only python >= 3.5 is supported, while you're using python 2.7
  Running `maturin pep517 build-wheel -i python --bindings=cffi --manylinux=2010`
  Error: Command '['maturin', 'pep517', 'build-wheel', '-i', 'python', '--bindings=cffi', '--manylinux=2010']' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for shaloop
Failed to build shaloop
ERROR: Could not build wheels for shaloop which use PEP 517 and cannot be installed directly

although I use python >=3.5...

patrickselle commented 3 years ago

Found another solution, that worked well for me. Have a look at the c branch, clone and build locally :)