2

我正在尝试在 mac m1 big sur 11.3.1 上的 pyhton3.8.6 上安装“mediapipe”

因此,当我尝试安装 bazel 并运行“Hello World 桌面”示例时。

$ brew search bazel
==> Formulae
bazel ✔   bazelisk  babel     blaze     babeld

$ bazel --version
bazel 4.1.0-homebrew

所以我发现没有办法在 hmoebrew 上降级 bazel,但是当我运行这段代码时,

$ python3 setup.py install --link-opencv
running install
running build_binary_graphs
fail to get bazel version by $ bazel --version: b'\x1b[31mERROR: The project you\'re trying to build requires Bazel 3.7.2 (specified in /Users/san/work/tools/mediapipe/.bazelversion), but it wasn\'t found in /opt/homebrew/Cellar/bazel/4.1.0/libexec/bin.\x1b[0m\n\nBazel binaries for all official releases can be downloaded from here:\n  https://github.com/bazelbuild/bazel/releases\n\nYou can download the required version directly using this command:\n  (cd "/opt/homebrew/Cellar/bazel/4.1.0/libexec/bin" && curl -fLO https://releases.bazel.build/3.7.2/release/bazel-3.7.2-darwin-arm64 && chmod +x bazel-3.7.2-darwin-arm64)\n'%

很快,它说我要跑

cd "/opt/homebrew/Cellar/bazel/4.1.0/libexec/bin" && curl -fLO https://releases.bazel.build/3.7.2/release/bazel-3.7.2-darwin-arm64 && chmod +x bazel-3.7.2-darwin-arm64

所以我运行它,

$ cd "/opt/homebrew/Cellar/bazel/4.1.0/libexec/bin" && curl -fLO https://releases.bazel.build/3.7.2/release/bazel-3.7.2-darwin-arm64 && chmod +x bazel-3.7.2-darwin-arm64
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404

所以没有这样的文件,我跟踪了该站点,发现https://releases.bazel.build/3.7.2/release/上没有“bazel-3.7.2-darwin-arm64”

有什么要解决的吗?

4

2 回答 2

1

@James_Sharpe

这就是我遇到的确切问题。

我已经安装了 4.1.0。

所以这就是我看到这个错误的原因。

fail to get bazel version by 
$ bazel --version: b'\x1b[31mERROR: 
The project you\'re trying to build requires Bazel 3.7.2 
(specified in /Users/san/work/tools/mediapipe/.bazelversion), 
but it wasn\'t found in /opt/homebrew/Cellar/bazel/4.1.0/libexec/bin.\x1b[0m\n\nBazel binaries for 
all official releases can be downloaded from here:\n  
https://github.com/bazelbuild/bazel/releases\n\nYou can download the 
required version directly using this command:\n  
(cd "/opt/homebrew/Cellar/bazel/4.1.0/libexec/bin" && curl -fLO 
https://releases.bazel.build/3.7.2/release/bazel-3.7.2-darwin-arm64 && chmod +x bazel-3.7.2-darwin-arm64)\n'%
于 2021-07-21T03:48:36.007 回答
1

Apple Silicon 在 4 系列之前没有 bazel 版本(我认为4.1.0是第一个支持 M1 的版本)

您看到的错误是因为.bazelversion源存储库中的文件包含3.7.2在其中。尝试编辑它4.1.0以克服您看到的错误。

请注意,这将要求您从 mediapipe 源代码库安装,而不是通过 pip。

于 2021-07-20T09:24:15.130 回答