简体   繁体   English

如何在python2环境中安装Bazel?

[英]How do you install Bazel in python2 environment?

How do you install Bazel in a python2 environment? 如何在python2环境中安装Bazel? The tensorflow website has an error posted on the such as this "Caution: Because of an bazel bug, we only support building the Android demo app within a Python 2 environment", (See related Bazel installation on windows">Bazel installation on Windows). How do you install Bazel in a python2 environment( to get apps working on Windows, using bazel)? The Bazel install in a python2 environment may be a workaround for the error shown earlier on the Tensorflow website, they do not seem to have any other workarounds known. tensorflow网站上发布了一个错误,例如“警告:由于bazel错误,我们仅支持在Python 2环境中构建Android演示应用程序”,(请参阅Windows上相关的Bazel安装“> Windows上的Bazel安装) 。如何在python2环境中安装Bazel(要使用bazel使应用程序在Windows上运行)?在python2环境中安装Bazel可能是针对Tensorflow网站上先前显示的错误的解决方法,它们似乎没有任何作用其他已知的解决方法。

  1. Download and install Python2 (eg from python.org: Python 2.7.15, 64-bit version [1]) 下载并安装Python2(例如, 从python.org:Python 2.7.15,64位版本 [1])
  2. Use the --python_path flag [2] to tell Bazel where's the Python interpreter. 使用--python_path标志 [2]告诉Bazel Python解释器在哪里。

For example if you installed Python2 under c:\\python2 , run Bazel like so: 例如,如果您将Python2安装在c:\\python2 ,请像下面这样运行Bazel:

c:\tensorflow> bazel build --python_path=c:/python2/python.exe //foo:bar

If you want Bazel to always use this flag in this workspace ( c:\\tensorflow ), add the following line to c:\\tensorflow\\.bazelrc : 如果你想巴泽勒始终使用该标志在这个工作区( c:\\tensorflow ),添加以下行到c:\\tensorflow\\.bazelrc

build --python_path=c:/python2/python.exe

(You may need to add this line every time you re-run the configure script.) (您可能需要在每次重新运行configure脚本时添加此行。)

Update: here's more info about .bazelrc files [3], what they are, where they are, how to specify them. 更新: 这是有关.bazelrc文件 [3],它们是什么,它们在哪里,如何指定它们的更多信息


[1] https://www.python.org/ftp/python/2.7.15/python-2.7.15.amd64.msi [1] https://www.python.org/ftp/python/2.7.15/python-2.7.15.amd64.msi

[2] https://docs.bazel.build/versions/master/command-line-reference.html [2] https://docs.bazel.build/versions/master/command-line-reference.html

[3] https://docs.bazel.build/versions/master/user-manual.html#bazelrc [3] https://docs.bazel.build/versions/master/user-manual.html#bazelrc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM