简体   繁体   中英

BUG: Cannot install SciPy 1.9.3 in Python 3.10 in macOS

Tried to install SciPy from the terminal using pip and from the idle using Github, but none of it worked.

In the documentation it says that it should support Python 3.10, so I do not know the reason of the issue.

Every other package, I have had no issue to install.

Any ideas about how to solve?

This is the error shown:

Collecting scipy
  Using cached scipy-1.9.3.tar.gz (42.1 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 'error'

  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [68 lines of output]
      + meson setup --native-file=/private/var/folders/tn/l95fzft50tb2hg345rn97ykr0000gn/T/pip-install-gkrcavxq/scipy_93c0e9d042a14457b9a3a4073762f4c2/.mesonpy-native-file.ini -Ddebug=false -Doptimization=2 --prefix=/Library/Frameworks/Python.framework/Versions/3.10 /private/var/folders/tn/l95fzft50tb2hg345rn97ykr0000gn/T/pip-install-gkrcavxq/scipy_93c0e9d042a14457b9a3a4073762f4c2 /private/var/folders/tn/l95fzft50tb2hg345rn97ykr0000gn/T/pip-install-gkrcavxq/scipy_93c0e9d042a14457b9a3a4073762f4c2/.mesonpy-flu011q5/build
      The Meson build system
      Version: 0.64.0
      Source dir: /private/var/folders/tn/l95fzft50tb2hg345rn97ykr0000gn/T/pip-install-gkrcavxq/scipy_93c0e9d042a14457b9a3a4073762f4c2
      Build dir: /private/var/folders/tn/l95fzft50tb2hg345rn97ykr0000gn/T/pip-install-gkrcavxq/scipy_93c0e9d042a14457b9a3a4073762f4c2/.mesonpy-flu011q5/build
      Build type: native build
      Project name: SciPy
      Project version: 1.9.3
      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-but-set-variable: NO (cached)
      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:57: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/tn/l95fzft50tb2hg345rn97ykr0000gn/T/pip-install-gkrcavxq/scipy_93c0e9d042a14457b9a3a4073762f4c2/.mesonpy-flu011q5/build/meson-logs/meson-log.txt
      Traceback (most recent call last):
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
          main()
        File "/Library/Frameworks/Python.framework/Versions/3.10/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 "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/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/tn/l95fzft50tb2hg345rn97ykr0000gn/T/pip-build-env-0imxa7cb/overlay/lib/python3.10/site-packages/mesonpy/__init__.py", line 969, in get_requires_for_build_wheel
          with _project(config_settings) as project:
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 135, in __enter__
          return next(self.gen)
        File "/private/var/folders/tn/l95fzft50tb2hg345rn97ykr0000gn/T/pip-build-env-0imxa7cb/overlay/lib/python3.10/site-packages/mesonpy/__init__.py", line 948, in _project
          with Project.with_temp_working_dir(
        File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 135, in __enter__
          return next(self.gen)
        File "/private/var/folders/tn/l95fzft50tb2hg345rn97ykr0000gn/T/pip-build-env-0imxa7cb/overlay/lib/python3.10/site-packages/mesonpy/__init__.py", line 777, in with_temp_working_dir
          yield cls(source_dir, tmpdir, build_dir)
        File "/private/var/folders/tn/l95fzft50tb2hg345rn97ykr0000gn/T/pip-build-env-0imxa7cb/overlay/lib/python3.10/site-packages/mesonpy/__init__.py", line 682, in __init__
          self._configure(reconfigure=bool(build_dir) and not native_file_mismatch)
        File "/private/var/folders/tn/l95fzft50tb2hg345rn97ykr0000gn/T/pip-build-env-0imxa7cb/overlay/lib/python3.10/site-packages/mesonpy/__init__.py", line 713, in _configure
          self._meson(
        File "/private/var/folders/tn/l95fzft50tb2hg345rn97ykr0000gn/T/pip-build-env-0imxa7cb/overlay/lib/python3.10/site-packages/mesonpy/__init__.py", line 696, in _meson
          return self._proc('meson', *args)
        File "/private/var/folders/tn/l95fzft50tb2hg345rn97ykr0000gn/T/pip-build-env-0imxa7cb/overlay/lib/python3.10/site-packages/mesonpy/__init__.py", line 691, in _proc
          subprocess.check_call(list(args))
        File "/Library/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', '--native-file=/private/var/folders/tn/l95fzft50tb2hg345rn97ykr0000gn/T/pip-install-gkrcavxq/scipy_93c0e9d042a14457b9a3a4073762f4c2/.mesonpy-native-file.ini', '-Ddebug=false', '-Doptimization=2', '--prefix=/Library/Frameworks/Python.framework/Versions/3.10', '/private/var/folders/tn/l95fzft50tb2hg345rn97ykr0000gn/T/pip-install-gkrcavxq/scipy_93c0e9d042a14457b9a3a4073762f4c2', '/private/var/folders/tn/l95fzft50tb2hg345rn97ykr0000gn/T/pip-install-gkrcavxq/scipy_93c0e9d042a14457b9a3a4073762f4c2/.mesonpy-flu011q5/build']' 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: 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.

I'm guessing you're on macOS 11 with M1? (Please always give the OS and version as part of a question). If so, then scipy doesn't make wheels for macOS11 + M1, there are a few bugs that can't be removed. I advise upgrading to macOS 12 in this situation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM