微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无法在 Mac 上使用“pip install scipy”

如何解决无法在 Mac 上使用“pip install scipy”

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

我尝试了一些方法包括

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

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

它给了我 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,<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,<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.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。