Windows 10 Bazel_SH配置

时间:2017-09-12 16:41:13

标签: windows-10 python-3.5 bazel

我试图按照tensorflow上提供的指南运行一个bazel构建命令,到目前为止我没有成功。我使用的是Python 3.5.0版本

使用website上的指南正确安装和配置了Bazel,但无济于事。我总是收到同样的错误:

ERROR: in target '//external:cc_toolchain': no such package '@local_config_cc//': Traceback (most recent call last):
    File "C:/users/username/appdata/local/temp/_bazel_username/ykvutwrt/external/bazel_tools/tools/cpp/cc_configure.bzl", line 32
            configure_windows_toolchain(repository_ctx)
    File "C:/users/username/appdata/local/temp/_bazel_username/ykvutwrt/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 365, in configure_windows_toolchain
            tpl(repository_ctx, "CROSSTOOL", {"%{cpu...}": ""})
    File "C:/users/username/appdata/local/temp/_bazel_username/ykvutwrt/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 377, in tpl
            _get_escaped_windows_msys_crosstool_content(repository_ctx)
    File "C:/users/username/appdata/local/temp/_bazel_username/ykvutwrt/external/bazel_tools/tools/cpp/windows_cc_configure.bzl", line 34, in _get_escaped_windows_msys_crosstool_content
            get_env_var(repository_ctx, "BAZEL_SH")
    File "C:/users/username/appdata/local/temp/_bazel_username/ykvutwrt/external/bazel_tools/tools/cpp/lib_cc_configure.bzl", line 48, in get_env_var
            auto_configure_fail(("'%s' environment variable is n...))
    File "C:/users/username/appdata/local/temp/_bazel_username/ykvutwrt/external/bazel_tools/tools/cpp/lib_cc_configure.bzl", line 30, in auto_configure_fail
            fail(("\n%sAuto-Configuration Error:%...)))

Auto-Configuration Error: 'BAZEL_SH' environment variable is not set

我不确定该怎么做。

1 个答案:

答案 0 :(得分:3)

BAZEL_SH env var未设置,您是否运行了要求部分下显示的以下命令?

  

您还需要将BAZEL_SH环境变量设置为指向   bash.exe。例如,在Windows命令提示符(cmd.exe)中:

     

set BAZEL_SH=C:\msys64\usr\bin\bash.exe

您可能希望setxset the environment variable permanently一起使用。