ERROR: Dependency “OpenBLAS“ not found (MacOS,m1) Python 安装问题

使用pip 安装包 (sklearn, scipy ... ) 的时候总是出现这个问题,明明已经安装了 openblas (没有安装的朋友 `brew install openblas` 安装), 但就是找不到。

Run-time dependency openblas found: NO (tried pkgconfig, framework and cmake)
            Run-time dependency openblas found: NO (tried pkgconfig, framework and cmake)

            ../../scipy/meson.build:134:0: ERROR: Dependency "OpenBLAS" not found, tried pkgconfig, framework and cmake

            A full log can be found at /private/var/folders/mj/c_b9lkvn6x522_0zk2bl8t640000gp/T/pip-install-ylvj3qnf/scipy_473d2ef11643463eb16bc8ff3a65307c/.mesonpy-lmi4u5p2/build/meson-logs/meson-log.txt
            + meson setup --prefix=/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8 /private/var/folders/mj/c_b9lkvn6x522_0zk2bl8t640000gp/T/pip-install-ylvj3qnf/scipy_473d2ef11643463eb16bc8ff3a65307c /private/var/folders/mj/c_b9lkvn6x522_0zk2bl8t640000gp/T/pip-install-ylvj3qnf/scipy_473d2ef11643463eb16bc8ff3a65307c/.mesonpy-lmi4u5p2/build --native-file=/private/var/folders/mj/c_b9lkvn6x522_0zk2bl8t640000gp/T/pip-install-ylvj3qnf/scipy_473d2ef11643463eb16bc8ff3a65307c/.mesonpy-native-file.ini -Ddebug=false -Doptimization=2
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: metadata-generation-failed

      × Encountered error while generating package metadata.
      ╰─> See above for output.

      note: This is an issue with the package mentioned above, not pip.
      hint: See above for details.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies 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.

大多数时候可以使用 conda解决。

conda install --channel=conda-forge your_package

安装sklearn时conda 不管用了,最终使用以下语句解决

export PKG_CONFIG_PATH="/opt/homebrew/opt/openblas/lib/pkgconfig"
export LDFLAGS="-L/opt/homebrew/opt/openblas/lib"  
export CPPFLAGS="-I/opt/homebrew/opt/openblas/include"

Ref: https://github.com/pyenv/pyenv/issues/2394

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值