Mac M1 使用 Bazel 低版本

在mac m1芯片 上使用 bazel 遇到问题:

ERROR: The project you’re trying to build requires Bazel 3.1.0 (specified in /Users/libra/Projects/tensorflow/.bazelversion), but it wasn’t found in /opt/homebrew/Cellar/bazel/5.0.0/libexec/bin.

Bazel binaries for all official releases can be downloaded from here:
https://github.com/bazelbuild/bazel/releases

You can download the required version directly using this command:
(cd “/opt/homebrew/Cellar/bazel/5.0.0/libexec/bin” && curl -fLO https://releases.bazel.build/3.1.0/release/bazel-3.1.0-darwin-arm64 && chmod +x bazel-3.1.0-darwin-arm64)

按照提示:下载 bazel-3.1.0-darwin-arm64 然后会报404,因为bazel-3.1.0 没有编译darwin-arm64版本: 在这里插入图片描述
此时直接 修改 命令 下载x86版本

(cd "/opt/homebrew/Cellar/bazel/5.0.0/libexec/bin" && curl -fL -o bazel-3.1.0 https://releases.bazel.build/3.1.0/release/bazel-3.1.0-darwin-x86_64 && chmod +x bazel-3.1.0

注意 不要使用默认文件名 bazel-3.1.0-darwin-x86_64

如果遇到 提示可执行文件架构不支持,需执行shell:softwareupdate --install-rosetta 安装 rosetta

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值