facebookresearch / mmf

A modular framework for vision & language multimodal research from Facebook AI Research (FAIR)

Home Page:https://mmf.sh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mac M1 pip installation error

Podidiving opened this issue Β· comments

πŸ› Bug

Hi everyone! πŸ‘‹πŸΏ

I tried to install mmf using pip on my Mac machine and encountered a weird error.

To Reproduce

Steps to reproduce the behavior:

  1. conda create -n mmf python=3.8
  2. conda activate mmf
  3. conda install pytorch
  4. pip install --upgrade --pre mmf

Here is the error, after the fourth step:

Collecting mmf
  Using cached mmf-1.0.0rc10.tar.gz (160 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting GitPython==3.1.0
  Using cached GitPython-3.1.0-py3-none-any.whl (450 kB)
Collecting fasttext==0.9.1
  Using cached fasttext-0.9.1.tar.gz (57 kB)
  Preparing metadata (setup.py) ... done
Collecting demjson==2.2.4
  Using cached demjson-2.2.4-py3-none-any.whl
Collecting torchtext==0.5.0
  Using cached torchtext-0.5.0-py3-none-any.whl (73 kB)
Collecting mmf
  Using cached mmf-1.0.0rc9.tar.gz (160 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
  Using cached mmf-1.0.0rc8.tar.gz (159 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  Γ— Getting requirements to build wheel did not run successfully.
  β”‚ exit code: 1
  ╰─> [18 lines of output]
      Traceback (most recent call last):
        File "/Users/podidiving/miniconda3/envs/mmf/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
          main()
        File "/Users/podidiving/miniconda3/envs/mmf/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/podidiving/miniconda3/envs/mmf/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/private/var/folders/yq/l3rq2lw55t923sygld_4m2rm0000gn/T/pip-build-env-k3qu_um8/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/private/var/folders/yq/l3rq2lw55t923sygld_4m2rm0000gn/T/pip-build-env-k3qu_um8/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/yq/l3rq2lw55t923sygld_4m2rm0000gn/T/pip-build-env-k3qu_um8/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 484, in run_setup
          super(_BuildMetaLegacyBackend,
        File "/private/var/folders/yq/l3rq2lw55t923sygld_4m2rm0000gn/T/pip-build-env-k3qu_um8/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 335, in run_setup
          exec(code, locals())
        File "<string>", line 107, in <module>
        File "<string>", line 52, in fetch_requirements
      FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Γ— Getting requirements to build wheel did not run successfully.
β”‚ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Expected behavior

To have mmf installed

Environment

Collecting environment information...
PyTorch version: 1.12.1
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 13.1 (arm64)
GCC version: Could not collect
Clang version: 14.0.0 (clang-1400.0.29.202)
CMake version: version 3.24.1
Libc version: N/A

Python version: 3.8.15 (default, Nov 24 2022, 08:57:44)  [Clang 14.0.6 ] (64-bit runtime)
Python platform: macOS-13.1-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.23.5
[pip3] torch==1.12.1
[conda] numpy                     1.23.5           py38h1398885_0
[conda] numpy-base                1.23.5           py38h90707a3_0
[conda] pytorch                   1.12.1          cpu_py38h6ba7f14_0

Additional

When I tried to install from source (pip install --editable .) I encountered the following error (actual output is too huge, won't be able to paste it all, here is only the tail)

        File "/private/var/folders/yq/l3rq2lw55t923sygld_4m2rm0000gn/T/pip-install-4n_9f1gm/grpcio_70c39ab170b4404d9dabd9730024f7e4/src/python/grpcio/commands.py", line 263, in new_compile
          return old_compile(obj, src, ext, cc_args, extra_postargs,
        File "/Users/podidiving/miniconda3/envs/mmf/lib/python3.8/site-packages/setuptools/_distutils/unixccompiler.py", line 188, in _compile
          raise CompileError(msg)
      distutils.errors.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: legacy-install-failure

Γ— Encountered error while trying to install package.
╰─> grpcio

Okay, it seems that using python's version 3.8.13, running within virtualenv and installing grpcio beforehand (pip install grpcio) did the trick: I was able to install mmf from source (pip install --editable .)

But I have no idea, why it worked πŸ˜ƒ

Would be great to hear some thoughts on this problem.

this should be fixed now

this should be fixed now

Great, thanks!