无法在Mac上使用“pip安装scipy”

2024-06-02 07:47:59 发布

您现在位置:Python中文网/ 问答频道 /正文

我是Python的新手,我试图使用pip install scipy在Mac上安装scipy,但它似乎不起作用

我尝试了一些方法,包括:

  • 更新pip
  • 使用pip3
  • 使用--no cache dir选项
  • 安装lapack
  • 安装openblas

这些都是我在谷歌上找到的一些东西,我认为可能有用,所以如果我在做一些毫无意义的事情,请不要评判我

它给了我3000多行错误代码,我无法将它们全部粘贴到这里,所以让我发布其中的一部分

我已经记录了整个过程,所以如果我发布了与问题无关的部分,请让我知道

Collecting scipy
 Using cached scipy-1.6.3.tar.gz (27.2 MB)
 Installing build dependencies ... error
 ERROR: Command errored out with exit status 1:
  command: /opt/homebrew/opt/python@3.9/bin/python3.9 /private/var/folders/3q/pdq6tmxs7wgf87x6gyqlwj8r0000gn/T/pip-standalone-pip-8t3nz8x6/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/3q/pdq6tmxs7wgf87x6gyqlwj8r0000gn/T/pip-build-env-h67ky2lo/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- ‘wheel<0.37.0’ ‘setuptools<=51.0.0’ ‘Cython>=0.29.18,<3.0’ ‘pybind11>=2.4.3,<2.7.0’ ‘numpy==1.19.2; python_version==‘“’”‘3.6’“‘”’ and platform_machine==‘“’”‘aarch64’“‘”’' ‘numpy==1.19.2; python_version==‘“’”‘3.7’“‘”’ and platform_machine==‘“’”‘aarch64’“‘”’' ‘numpy==1.16.5; python_version==‘“’”‘3.6’“‘”’ and platform_machine!=‘“’”‘aarch64’“‘”’ and platform_python_implementation != ‘“’”‘PyPy’“‘”’' ‘numpy==1.16.5; python_version==‘“’”‘3.7’“‘”’ and platform_machine!=‘“’”‘aarch64’“‘”’ and platform_python_implementation != ‘“’”‘PyPy’“‘”’' ‘numpy==1.17.3; python_version==‘“’”‘3.8’“‘”’ and platform_machine!=‘“’”‘aarch64’“‘”’ and platform_python_implementation != ‘“’”‘PyPy’“‘”’' ‘numpy==1.19.3; python_version==‘“’”‘3.9’“‘”’ and platform_python_implementation != ‘“’”‘PyPy’“‘”’' ‘numpy==1.19.0; python_version==‘“’”‘3.6’“‘”’ and platform_python_implementation==‘“’”‘PyPy’“‘”’' ‘numpy==1.20.0; python_version==‘“’”‘3.7’“‘”’ and platform_python_implementation==‘“’”‘PyPy’“‘”’' ‘numpy; python_version>=‘“’”‘3.10’“‘”’' ‘numpy; python_version>=‘“’”‘3.8’“‘”’ and platform_python_implementation==‘“’”‘PyPy’“‘”’'
    cwd: None
 Complete output (917 lines):
 
-------------------- (followed by enormous lines of error code)

  ----------------------------------------
  ERROR: Failed building wheel for numpy
 Failed to build numpy
 ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
 ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/fe/fd/8704c7b7b34cdac850485e638346025ca57c5a859934b9aa1be5399b33b7/scipy-1.6.3.tar.gz#sha256=a75b014d3294fce26852a9d04ea27b5671d86736beb34acdfc05859246260707 (from https://pypi.org/simple/scipy/) (requires-python:>=3.7,<3.10). Command errored out with exit status 1: /opt/homebrew/opt/python@3.9/bin/python3.9 /private/var/folders/3q/pdq6tmxs7wgf87x6gyqlwj8r0000gn/T/pip-standalone-pip-8t3nz8x6/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/3q/pdq6tmxs7wgf87x6gyqlwj8r0000gn/T/pip-build-env-h67ky2lo/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- ‘wheel<0.37.0’ ‘setuptools<=51.0.0’ ‘Cython>=0.29.18,<3.0’ ‘pybind11>=2.4.3,<2.7.0’ ‘numpy==1.19.2; python_version==‘“’”‘3.6’“‘”’ and platform_machine==‘“’”‘aarch64’“‘”’' ‘numpy==1.19.2; python_version==‘“’”‘3.7’“‘”’ and platform_machine==‘“’”‘aarch64’“‘”’' ‘numpy==1.16.5; python_version==‘“’”‘3.6’“‘”’ and platform_machine!=‘“’”‘aarch64’“‘”’ and platform_python_implementation != ‘“’”‘PyPy’“‘”’' ‘numpy==1.16.5; python_version==‘“’”‘3.7’“‘”’ and platform_machine!=‘“’”‘aarch64’“‘”’ and platform_python_implementation != ‘“’”‘PyPy’“‘”’' ‘numpy==1.17.3; python_version==‘“’”‘3.8’“‘”’ and platform_machine!=‘“’”‘aarch64’“‘”’ and platform_python_implementation != ‘“’”‘PyPy’“‘”’' ‘numpy==1.19.3; python_version==‘“’”‘3.9’“‘”’ and platform_python_implementation != ‘“’”‘PyPy’“‘”’' ‘numpy==1.19.0; python_version==‘“’”‘3.6’“‘”’ and platform_python_implementation==‘“’”‘PyPy’“‘”’' ‘numpy==1.20.0; python_version==‘“’”‘3.7’“‘”’ and platform_python_implementation==‘“’”‘PyPy’“‘”’' ‘numpy; python_version>=‘“’”‘3.10’“‘”’' ‘numpy; python_version>=‘“’”‘3.8’“‘”’ and platform_python_implementation==‘“’”‘PyPy’“‘”’' Check the logs for full command output.
 Using cached scipy-1.6.2.tar.gz (27.2 MB)
 Installing build dependencies ... error
 ERROR: Command errored out with exit status 1:
  command: /opt/homebrew/opt/python@3.9/bin/python3.9 /private/var/folders/3q/pdq6tmxs7wgf87x6gyqlwj8r0000gn/T/pip-standalone-pip-jmzltc6_/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/3q/pdq6tmxs7wgf87x6gyqlwj8r0000gn/T/pip-build-env-a53k63qq/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- ‘wheel<0.37.0’ ‘setuptools<=51.0.0’ ‘Cython>=0.29.18,<3.0’ ‘pybind11>=2.4.3,<2.7.0’ ‘numpy==1.19.2; python_version==‘“’”‘3.6’“‘”’ and platform_machine==‘“’”‘aarch64’“‘”’' ‘numpy==1.19.2; python_version==‘“’”‘3.7’“‘”’ and platform_machine==‘“’”‘aarch64’“‘”’' ‘numpy==1.16.5; python_version==‘“’”‘3.6’“‘”’ and platform_machine!=‘“’”‘aarch64’“‘”’ and platform_python_implementation != ‘“’”‘PyPy’“‘”’' ‘numpy==1.16.5; python_version==‘“’”‘3.7’“‘”’ and platform_machine!=‘“’”‘aarch64’“‘”’ and platform_python_implementation != ‘“’”‘PyPy’“‘”’' ‘numpy==1.17.3; python_version==‘“’”‘3.8’“‘”’ and platform_machine!=‘“’”‘aarch64’“‘”’ and platform_python_implementation != ‘“’”‘PyPy’“‘”’' ‘numpy==1.19.3; python_version==‘“’”‘3.9’“‘”’ and platform_python_implementation != ‘“’”‘PyPy’“‘”’' ‘numpy==1.19.0; python_version==‘“’”‘3.6’“‘”’ and platform_python_implementation==‘“’”‘PyPy’“‘”’' ‘numpy==1.20.0; python_version==‘“’”‘3.7’“‘”’ and platform_python_implementation==‘“’”‘PyPy’“‘”’' ‘numpy; python_version>=‘“’”‘3.10’“‘”’' ‘numpy; python_version>=‘“’”‘3.8’“‘”’ and platform_python_implementation==‘“’”‘PyPy’“‘”’'
    cwd: None
 Complete output (917 lines):

---------- (similar kind of error continues for several times)

ERROR: Command errored out with exit status 1: /opt/homebrew/opt/python@3.9/bin/python3.9 -u -c ‘import io, os, sys, setuptools, tokenize; sys.argv[0] = ‘“’”‘/private/var/folders/3q/pdq6tmxs7wgf87x6gyqlwj8r0000gn/T/pip-install-7uaz68dq/scipy_34cf1cb5de5c4d9099c185a951b46ec9/setup.py’“‘”’; __file__=‘“’”‘/private/var/folders/3q/pdq6tmxs7wgf87x6gyqlwj8r0000gn/T/pip-install-7uaz68dq/scipy_34cf1cb5de5c4d9099c185a951b46ec9/setup.py’“‘”’;f = getattr(tokenize, ‘“’”‘open’“‘”’, open)(__file__) if os.path.exists(__file__) else io.StringIO(‘“’”‘from setuptools import setup; setup()‘“’”‘);code = f.read().replace(‘“’”‘\r\n’“‘”’, ‘“’”‘\n’“‘”’);f.close();exec(compile(code, __file__, ‘“’”‘exec’“‘”’))' install --record /private/var/folders/3q/pdq6tmxs7wgf87x6gyqlwj8r0000gn/T/pip-record-68boahxh/install-record.txt --single-version-externally-managed --compile --install-headers /opt/homebrew/include/python3.9/scipy Check the logs for full command output.

Tags: installpipandnonumpyversionvarscipy