1

我试图在 xcode 中构建 HandTracker 目标并得到这个错误。

error: An error occurred during the fetch of repository 'local_execution_config_python':
   Traceback (most recent call last):
    File "/private/var/tmp/_bazel_air/295474371363cb7bb712bb69027e5852/external/org_tensorflow/third_party/py/python_configure.bzl", line 213, column 39, in _create_local_python_repository
        numpy_include = _get_numpy_include(repository_ctx, python_bin) + "/numpy"
    File "/private/var/tmp/_bazel_air/295474371363cb7bb712bb69027e5852/external/org_tensorflow/third_party/py/python_configure.bzl", line 187, column 19, in _get_numpy_include
        return execute(
    File "/private/var/tmp/_bazel_air/295474371363cb7bb712bb69027e5852/external/org_tensorflow/third_party/remote_config/common.bzl", line 217, column 13, in execute
        fail(
Error in fail: Problem getting numpy include path.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'
Is numpy installed?
error: Analysis of aspect '@tulsi//:tulsi/tulsi_aspects.bzl%tulsi_outputs_aspect of //mediapipe/examples/ios/handtrackinggpu:HandTrackingGpuApp' failed; build aborted: Problem getting numpy include path.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'
Is numpy installed?
note: Elapsed time: 12,284s
note: 0 processes.
error: Build did NOT complete successfully (4 packages loaded, 7 targets configured)
<*> Running Bazel completed in 12509.306 ms
/Users/air/Documents/Mediapipe.xcodeproj/.tulsi/Scripts/bazel_build.py:569: error: Bazel build failed with exit code 1. Please check the build log in Report Navigator (⌘9) for more information.

这里说我没有numpy,但是我是通过pip install numpy安装的。

点子列表输出:

Package       Version
------------- --------
absl-py       0.11.0
dataclasses   0.6
numpy         1.19.3
opencv-python 4.4.0.46
pip           20.3.3
protobuf      3.14.0
setuptools    47.1.0
six           1.15.0
wheel         0.36.2

起初,该项目是正常构建的,但后来我不记得我做了什么,这些错误就开始了。Python 3.8.5、macOS 11.1、bazel 3.7.2

4

2 回答 2

0

当我使用 sudo 构建 bazel 时,我遇到了类似的问题!当我删除 sudo 时,一切正常。

于 2021-01-18T08:07:14.403 回答
-1

Bazel 的目标之一是使构建可重现,因此它不能依赖于特定于机器的库。

您需要使用 定义依赖关系pip_import

于 2020-12-28T12:05:38.290 回答