Tensorflow 1.5构建失败-缺少路径?

Phi*_*ith 2 python numpy tensorflow

我一直在按照教程在macOS上安装和构建Tensorflow。当我尝试构建它时,我使用以下命令:

bazel build --config=cuda --config=opt --copt=-msse4.2 --copt=-mpopcnt --copt=-maes --copt=-mcx16 --verbose_failures --action_env PATH --action_env LD_LIBRARY_PATH --action_env DYLD_LIBRARY_PATH //tensorflow/tools/pip_package:build_pip_package
Run Code Online (Sandbox Code Playgroud)

它几乎立即失败:

ERROR: /Users/psmith/tensorflow/third_party/py/numpy/BUILD:11:1: no such package '@local_config_python//': Traceback (most recent call last):
    File "/Users/psmith/tensorflow/third_party/py/python_configure.bzl", line 291
        _create_local_python_repository(repository_ctx)
    File "/Users/psmith/tensorflow/third_party/py/python_configure.bzl", line 255, in _create_local_python_repository
        _get_numpy_include(repository_ctx, python_bin)
    File "/Users/psmith/tensorflow/third_party/py/python_configure.bzl", line 239, in _get_numpy_include
        _execute(repository_ctx, [python_bin, "-c",..."], <2 more arguments>)
    File "/Users/psmith/tensorflow/third_party/py/python_configure.bzl", line 54, in _execute
        _fail("\n".join([error_msg.strip() if ... ""]))
    File "/Users/psmith/tensorflow/third_party/py/python_configure.bzl", line 27, in _fail
        fail(("%sPython Configuration Error:%...)))
Python Configuration Error: Problem getting numpy include path.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'
Is numpy installed?
 and referenced by '//third_party/py/numpy:headers'
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: Loading failed
INFO: Elapsed time: 0.287s
FAILED: Build did NOT complete successfully (2 packages loaded)
    currently loading: tensorflow/core ... (2 packages)
Run Code Online (Sandbox Code Playgroud)

我已经测试并验证了numpy已实际安装。我还强制升级并重新安装。我可以运行Python3>导入numpy而不会出现错误。

Phi*_*ith 5

通过将以下内容添加到bazel命令中,我能够克服此错误:

--action_env PYTHON_BIN_PATH=/usr/bin/python 
Run Code Online (Sandbox Code Playgroud)