簡體   English   中英

BUG:無法在 macOS 中的 Python 3.10 中安裝 SciPy 1.9.3

[英]BUG: Cannot install SciPy 1.9.3 in Python 3.10 in macOS

嘗試使用 pip 從終端安裝 SciPy 並使用 Github 從空閑安裝,但均無效。

在文檔中它說它應該支持 Python 3.10,所以我不知道問題的原因。

每隔 package,我安裝沒有問題。

關於如何解決的任何想法?

這是顯示的錯誤:

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.

我猜您使用的是帶有 M1 的 macOS 11? (請始終將操作系統和版本作為問題的一部分提供)。 如果是這樣,那么 scipy 並沒有為 macOS11 + M1 造輪子,有一些無法消除的錯誤。 在這種情況下,我建議升級到 macOS 12。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM