From 1da999d7e0547f8595ee2d5d075b55918e44bc6f Mon Sep 17 00:00:00 2001 From: Naren Dasan Date: Wed, 12 May 2021 17:01:35 -0700 Subject: [PATCH] feat(//py): Catch when bazel is not in path and error out when running setup.py Signed-off-by: Naren Dasan Signed-off-by: Naren Dasan --- py/setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py/setup.py b/py/setup.py index a27b4091e7..dfaf3f1326 100644 --- a/py/setup.py +++ b/py/setup.py @@ -46,6 +46,8 @@ def is_exe(fpath): BAZEL_EXE = which("bazel") +if BAZEL_EXE is None: + sys.exit("Could not find bazel in PATH") def build_libtrtorch_pre_cxx11_abi(develop=True, use_dist_dir=True, cxx11_abi=False): cmd = [BAZEL_EXE, "build"]