简体   繁体   English

BUG:无法在 macOS 中的 Python 3.10 中安装 SciPy 1.9.3

[英]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.尝试使用 pip 从终端安装 SciPy 并使用 Github 从空闲安装,但均无效。

In the documentation it says that it should support Python 3.10, so I do not know the reason of the issue.在文档中它说它应该支持 Python 3.10,所以我不知道问题的原因。

Every other package, I have had no issue to install.每隔 package,我安装没有问题。

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?我猜您使用的是带有 M1 的 macOS 11? (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.如果是这样,那么 scipy 并没有为 macOS11 + M1 造轮子,有一些无法消除的错误。 I advise upgrading to macOS 12 in this situation.在这种情况下,我建议升级到 macOS 12。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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