【问题标题】:Troubles installing Numpy 1.19.5 with Python 3.9.1 on macOS BigSur在 macOS BigSur 上使用 Python 3.9.1 安装 Numpy 1.19.5 时出现问题
【发布时间】:2023-03-04 18:42:02
【问题描述】:

正如标题所说,我使用的是带有 Apple 芯片的 macOS Big Sur 11.1。我刚刚从 python.org 上的可下载链接安装了 Python 3.9.1。当我尝试按如下方式安装 Numpy 1.19.5 时:

python3 -m pip install numpy -U

我得到以下(截断的)输出:

Collecting numpy
  Using cached numpy-1.19.5.zip (7.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: numpy
  Building wheel for numpy (PEP 517) ... error
.
.
.
  ----------------------------------------
  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

我已尝试按如下方式降级 numpy:

python3 -m pip install numpy==1.15.3

我得到了类似的错误。提前致谢!

【问题讨论】:

  • 尚不支持,已在 numpy github 问题上得到回应

标签: python python-3.x macos numpy


【解决方案1】:

这是因为 Numpy 还不能用于 python 3.9 版。 只需使用 3.8 版创建一个新的 conda 环境:

conda create -n ENV_NAME python=3.8.5

...并通过 pip 安装 Numpy

pip install numpy

在 M1 和 macOS Big Sur 上像魅力一样工作。 此解决方法也是此 GitHub 问题的输出: https://github.com/numpy/numpy/issues/17807

【讨论】:

    猜你喜欢
    • 2021-03-04
    • 1970-01-01
    • 2022-08-12
    • 2018-04-14
    • 1970-01-01
    • 2021-03-04
    • 1970-01-01
    • 2021-08-18
    • 2021-04-12
    相关资源
    最近更新 更多