最近,我尝试从MacOS计算机上的源代码安装TensorFlow模块。到目前为止,我已经通过安装Python 3.6,TensorFlow pip软件包依赖项(我已经安装了pip)并使用其网站上提供的命令安装了Bazel取得了进步。在了解到此错误之后,我首先使用Python 3.6配置了源树,然后使用2.7配置了源树。但是,不久之后,当我输入命令时:
bazel build -config=opt//tensorflow/tools/pip_package:build_pip_package
我收到此消息:
Starting local Bazel server and connecting to it...
INFO: Invocation ID: 2028ac42-5ccd-4c28-9156-e7d547c89263
ERROR: /private/var/tmp/_bazel_surengrigorian/c9e5c7de228d990fbf93866f2deac188/external/local_config_cc/BUILD:58:5: in apple_cc_toolchain rule
@local_config_cc//:cc-compiler-watchos_arm64_32: Xcode version must be specified to use an Apple CROSSTOOL. If your Xcode version has changed recently, try: "bazel clean --expunge" to re-run Xcode configuration
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: Analysis of target '@local_config_cc//:cc-compiler- watchos_arm64_32' failed; build aborted
INFO: Elapsed time: 11.538s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (171 packages loaded, 3109 targets\
configured)
currently loading: tensorflow/core/kernels
Fetching @swig; fetching 4s
Fetching @grpc; fetching
感谢您提供有关如何解决此错误的任何帮助。
答案 0 :(得分:0)
我有同样的问题。我通过降级Bazel版本解决了它。就我而言,Bazel 21.0无法正常工作。将bazel重新安装到18.0可以正常工作。 https://github.com/bazelbuild/bazel/releases/tag/0.18.0
答案 1 :(得分:0)
降级到Bazel 0.29.1对我有用。