我尝试使这个示例工作,但是每次我尝试使用 bazel 构建程序时,都会收到以下错误消息:
bazel build //code:label_image
ERROR: /home/jonas/tensorflow/code/BUILD:12:1: no such package 'tensorflow': BUILD file not found on package path and referenced by '//code:label_image'.
ERROR: /home/jonas/tensorflow/code/BUILD:12:1: no such package 'tensorflow': BUILD file not found on package path and referenced by '//code:label_image'.
ERROR: /home/jonas/tensorflow/code/BUILD:12:1: no such package 'tensorflow': BUILD file not found on package path and referenced by '//code:label_image'.
ERROR: /home/jonas/tensorflow/code/BUILD:12:1: no such package 'tensorflow': BUILD file not found on package path and referenced by '//code:label_image'.
ERROR: /home/jonas/tensorflow/code/BUILD:12:1: no such package 'tensorflow': BUILD file not found on package path and referenced by '//code:label_image'.
ERROR: Analysis of target '//code:label_image' failed; build aborted.
INFO: Elapsed time: 1.261s
我将来自 github 的确切源代码保存在一个名为code
. 我通过 pip: 安装tensorflow
在(活动)虚拟环境中pip3 install --upgrade tensorflow
。我使用拱 linux。
为什么 bazel 找不到合适的包?我对 bazel/tensorflow 很陌生。这些包保存在哪里?我必须在某处明确指定它们吗?