Models: MacOS - error running bazel build //scripts:bazel-complete.bash

Created on 19 May 2016  Â·  7Comments  Â·  Source: tensorflow/models

I'm trying to install bazel 0.2.2 on a MacOS 10.9.5 with JDK 8.
I downloaded the installer, ran it and set up the environment as written in http://bazel.io/docs/install.html

Then I want to install the bash completion.
When I'm in models/syntaxnet

bazel build //scripts:bazel-complete.bash
ERROR: no such package 'scripts': BUILD file not found on package path.

If I am in ~/.bazel, the result is:

bazel build //scripts:bazel-complete.bash
The 'build' command is only supported from within a workspace.

Surely I'm doing some silly error but I cannot understand what's wrong.

thanks
alberto

Most helpful comment

$ touch WORKSPACE is the solution

All 7 comments

You have to refer to Getting Started with Bazel

Thanks for the suggestion.
To be honest, I find "Getting Started with Bazel" quite obscure.
It describes what to do for creating a small Java project but it's not clear what to do for my much simpler problem (i.e. getting bash completion after installing bazel).
In the installation instructions for "Getting bash completion" it is simply said to run
'bazel build //scripts:bazel-complete.bash'
and so I had assumed that it would have worked without any additional complication.
I'll read "Getting Started with Bazel" again and I'll try to figure out what to do.
Thanks

hello I have the same problem in ubuntu16.04。
yl@ubuntu:~/models/syntaxnet$ bazel build //scripts:bazel-complete.bash
........................
ERROR: no such package 'scripts': BUILD file not found on package path.
INFO: Elapsed time: 0.952s
and bazel test also have some error

what was the solution?

$ touch WORKSPACE is the solution

I followed the install instructions at
https://bazel.io/versions/master/docs/install.html#install-on-ubuntu
but still got the below errors:

$ touch WORKSPACE
$ bazel build //scripts:bazel-complete.bash
..........
ERROR: no such package 'scripts': BUILD file not found on package path.
INFO: Elapsed time: 0.391s

$ bazel version
Build label: 0.3.2
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Oct 7 17:25:10 2016 (1475861110)
Build timestamp: 1475861110
Build timestamp as int: 1475861110

Make sure you have cd inside the tensorflow folder containing the WORKSPACE file (the root of the cloned tensorflow).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

XavDCtpz picture XavDCtpz  Â·  3Comments

kamal4493 picture kamal4493  Â·  3Comments

frankkloster picture frankkloster  Â·  3Comments

trungdn picture trungdn  Â·  3Comments

hanzy123 picture hanzy123  Â·  3Comments