gpt4 book ai didi

python - 错误 : "http_archive" is not defined when starting the local Bazel server in the TensorFlow Installation

转载 作者:行者123 更新时间:2023-12-05 00:57:08 25 4
gpt4 key购买 nike

我正在安装 Tensorflow。 我遇到了以下问题:我正在从 Source 安装 Tensorflow,并且正在关注 Tensorflow 网站 (https://www.tensorflow.org/install/source)

我之前安装了 Bazel 3.0.0(最新版本),但遇到了类似的错误。在查看其他答案后,我发现此错误与 Bazel 的版本有关。因此我卸载了 Bazel 3.0.0 并安装了 Bazel 0.27.1。但是在终端中输入以下命令(bazel build//tensorflow/tools/pip_package:build_pip_package),我收到以下错误:

WARNING: The following rc files are no longer being read, please transfer their contents or import their path into one of the standard rc files:
/home/aviraj/tensorflow/tools/bazel.rc
Starting local Bazel server and connecting to it...
ERROR: /home/aviraj/tensorflow/WORKSPACE:3:1: name 'http_archive' is not defined
ERROR: Error evaluating WORKSPACE file
ERROR: error loading package '': Encountered error while reading extension file 'closure/defs.bzl': no such package '@io_bazel_rules_closure//closure': error loading package 'external': Could not load //external package
ERROR: error loading package '': Encountered error while reading extension file 'closure/defs.bzl': no such package '@io_bazel_rules_closure//closure': error loading package 'external': Could not load //external package
INFO: Elapsed time: 2.023s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)

任何帮助将不胜感激。谢谢

最佳答案

从 0.20.0 版本开始,http_archive 原生规则已被弃用,它必须从以下位置加载:@bazel_tools//tools/build_defs/repo:http.bzl。 IE。您需要使用它在 WORKSPACEbzl 文件中添加以下内容(除非您有自定义版本):

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

关于python - 错误 : "http_archive" is not defined when starting the local Bazel server in the TensorFlow Installation,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61163675/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com