Repository: stable-diffusion-webui
Issue: [Bug]: Preparing metadata (pyproject.toml): finished with status 'error'
Labels: bug-report,platform:mac

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What happened?

Fails to install gfpgan

RuntimeError: Couldn't install gfpgan.
Command: "/Users/<>/stable-diffusion-webui/venv/bin/python3.10" -m pip install git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 --prefer-binary
Error code: 1
stdout: Collecting git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379
  Cloning https://github.com/TencentARC/GFPGAN.git (to revision 8d2447a2d918f8eba5a4a01463fd48e45126a379) to /private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-req-build-xf8xy87a
  Resolved https://github.com/TencentARC/GFPGAN.git to commit 8d2447a2d918f8eba5a4a01463fd48e45126a379
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting basicsr>=1.4.2
  Using cached basicsr-1.4.2.tar.gz (172 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting facexlib>=0.2.5
  Using cached facexlib-0.2.5-py3-none-any.whl (59 kB)
Collecting lmdb
  Using cached lmdb-1.4.0.tar.gz (881 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: numpy in ./venv/lib/python3.10/site-packages (from gfpgan==1.3.5) (1.24.1)
Collecting opencv-python
  Using cached opencv_python-4.7.0.68-cp37-abi3-macosx_11_0_arm64.whl (31.1 MB)
Collecting pyyaml
  Using cached PyYAML-6.0-cp310-cp310-macosx_11_0_arm64.whl (173 kB)
Collecting scipy
  Using cached scipy-1.10.0.tar.gz (42.4 MB)
  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'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'error'

stderr:   Running command git clone --filter=blob:none --quiet https://github.com/TencentARC/GFPGAN.git /private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-req-build-xf8xy87a
  Running command git rev-parse -q --verify 'sha^8d2447a2d918f8eba5a4a01463fd48e45126a379'
  Running command git fetch -q https://github.com/TencentARC/GFPGAN.git 8d2447a2d918f8eba5a4a01463fd48e45126a379
  Running command git checkout -q 8d2447a2d918f8eba5a4a01463fd48e45126a379
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [74 lines of output]
      The Meson build system
      Version: 1.0.0
      Source dir: /private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-install-7htfqt1a/scipy_ac2eda9108734d6cb948549c8912ddb5
      Build dir: /private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-install-7htfqt1a/scipy_ac2eda9108734d6cb948549c8912ddb5/.mesonpy-mps_ri4v/build
      Build type: native build
      Project name: SciPy
      Project version: 1.10.0
      C compiler for the host machine: cc (clang 12.0.5 "Apple clang version 12.0.5 (clang-1205.0.22.11)")
      C linker for the host machine: cc ld64 650.9
      C++ compiler for the host machine: c++ (clang 12.0.5 "Apple clang version 12.0.5 (clang-1205.0.22.11)")
      C++ linker for the host machine: c++ ld64 650.9
      Host machine cpu family: aarch64
      Host machine cpu: aarch64
      Compiler for C supports arguments -Wno-unused-but-set-variable: NO
      Compiler for C supports arguments -Wno-unused-function: YES
      Compiler for C supports arguments -Wno-conversion: YES
      Compiler for C supports arguments -Wno-misleading-indentation: YES
      Compiler for C supports arguments -Wno-incompatible-pointer-types: YES
      Library m found: YES

      ../../meson.build:63:0: ERROR: Unknown compiler(s): [['gfortran'], ['flang'], ['nvfortran'], ['pgfortran'], ['ifort'], ['ifx'], ['g95']]
      The following exception(s) were encountered:
      Running `gfortran --version` gave "[Errno 2] No such file or directory: 'gfortran'"
      Running `gfortran -V` gave "[Errno 2] No such file or directory: 'gfortran'"
      Running `flang --version` gave "[Errno 2] No such file or directory: 'flang'"
      Running `flang -V` gave "[Errno 2] No such file or directory: 'flang'"
      Running `nvfortran --version` gave "[Errno 2] No such file or directory: 'nvfortran'"
      Running `nvfortran -V` gave "[Errno 2] No such file or directory: 'nvfortran'"
      Running `pgfortran --version` gave "[Errno 2] No such file or directory: 'pgfortran'"
      Running `pgfortran -V` gave "[Errno 2] No such file or directory: 'pgfortran'"
      Running `ifort --version` gave "[Errno 2] No such file or directory: 'ifort'"
      Running `ifort -V` gave "[Errno 2] No such file or directory: 'ifort'"
      Running `ifx --version` gave "[Errno 2] No such file or directory: 'ifx'"
      Running `ifx -V` gave "[Errno 2] No such file or directory: 'ifx'"
      Running `g95 --version` gave "[Errno 2] No such file or directory: 'g95'"
      Running `g95 -V` gave "[Errno 2] No such file or directory: 'g95'"

      A full log can be found at /private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-install-7htfqt1a/scipy_ac2eda9108734d6cb948549c8912ddb5/.mesonpy-mps_ri4v/build/meson-logs/meson-log.txt
      + meson setup --prefix=/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10 /private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-install-7htfqt1a/scipy_ac2eda9108734d6cb948549c8912ddb5 /private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-install-7htfqt1a/scipy_ac2eda9108734d6cb948549c8912ddb5/.mesonpy-mps_ri4v/build --native-file=/private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-install-7htfqt1a/scipy_ac2eda9108734d6cb948549c8912ddb5/.mesonpy-native-file.ini -Ddebug=false -Doptimization=2
      Traceback (most recent call last):
        File "/Users/<>/stable-diffusion-webui/venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 144, in prepare_metadata_for_build_wheel
          hook = backend.prepare_metadata_for_build_wheel
      AttributeError: module 'mesonpy' has no attribute 'prepare_metadata_for_build_wheel'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/Users/<>/stable-diffusion-webui/venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
          main()
        File "/Users/<>/stable-diffusion-webui/venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/<>/stable-diffusion-webui/venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 148, in prepare_metadata_for_build_wheel
          whl_basename = backend.build_wheel(metadata_directory, config_settings)
        File "/private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-build-env-ptlo7jat/overlay/lib/python3.10/site-packages/mesonpy/__init__.py", line 1060, in build_wheel
          with _project(config_settings) as project:
        File "/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 135, in __enter__
          return next(self.gen)
        File "/private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-build-env-ptlo7jat/overlay/lib/python3.10/site-packages/mesonpy/__init__.py", line 975, in _project
          with Project.with_temp_working_dir(
        File "/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 135, in __enter__
          return next(self.gen)
        File "/private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-build-env-ptlo7jat/overlay/lib/python3.10/site-packages/mesonpy/__init__.py", line 750, in with_temp_working_dir
          yield cls(source_dir, tmpdir, build_dir, meson_args)
        File "/private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-build-env-ptlo7jat/overlay/lib/python3.10/site-packages/mesonpy/__init__.py", line 632, in __init__
          self._configure(reconfigure=bool(build_dir) and not native_file_mismatch)
        File "/private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-build-env-ptlo7jat/overlay/lib/python3.10/site-packages/mesonpy/__init__.py", line 680, in _configure
          self._meson('setup', *setup_args)
        File "/private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-build-env-ptlo7jat/overlay/lib/python3.10/site-packages/mesonpy/__init__.py", line 657, in _meson
          return self._proc('meson', *args)
        File "/private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-build-env-ptlo7jat/overlay/lib/python3.10/site-packages/mesonpy/__init__.py", line 652, in _proc
          subprocess.check_call(list(args), env=self._env)
        File "/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['meson', 'setup', '--prefix=/opt/homebrew/Cellar/python@3.10/3.10.9/Frameworks/Python.framework/Versions/3.10', '/private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-install-7htfqt1a/scipy_ac2eda9108734d6cb948549c8912ddb5', '/private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-install-7htfqt1a/scipy_ac2eda9108734d6cb948549c8912ddb5/.mesonpy-mps_ri4v/build', '--native-file=/private/var/folders/mk/myzvqbcj3d55h73p6wtvcnzh0000gn/T/pip-install-7htfqt1a/scipy_ac2eda9108734d6cb948549c8912ddb5/.mesonpy-native-file.ini', '-Ddebug=false', '-Doptimization=2']' 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: 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.`

### Steps to reproduce the problem

1. brew install cmake protobuf rust python@3.10 git wget
2. ./webui.sh


### What should have happened?

Libs should have installed correctly 

### Commit where the problem happens

9cfd10c

### What platforms do you use to access UI ?

MacOS

### What browsers do you use to access the UI ?

Google Chrome

### Command Line Arguments

```Shell
n/a
```


### Additional information, context and logs

_No response_