Mediapipe: Running hello world example after install

Created on 2 Jun 2020  路  5Comments  路  Source: google/mediapipe

OS: Ubuntu 20.04 fresh install
running
export GLOG_logtostderr=1
bazel run --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hello_world:hello_world

Originally had the same network error, resolved using JVM solution in #581
Then got a python error (Python 3.8.2 is installed in Ubuntu 20.04), did an apt install of python 2.7 and I'm currently getting this numpy error.

numpy is installed but I think it's attached to my python3 and not 2.7

INFO: Repository local_execution_config_python instantiated at:
no stack (--record_rule_instantiation_callstack not enabled)
Repository rule local_python_configure defined at:
/home/mjcrouse/.cache/bazel/_bazel_mjcrouse/d4a5759ab5c8ecae004fbf3a12d053df/external/org_tensorflow/third_party/py/python_configure.bzl:275:41: in
ERROR: An error occurred during the fetch of repository 'local_execution_config_python':
Traceback (most recent call last):
File "/home/mjcrouse/.cache/bazel/_bazel_mjcrouse/d4a5759ab5c8ecae004fbf3a12d053df/external/org_tensorflow/third_party/py/python_configure.bzl", line 213
_get_numpy_include(<2 more arguments>)
File "/home/mjcrouse/.cache/bazel/_bazel_mjcrouse/d4a5759ab5c8ecae004fbf3a12d053df/external/org_tensorflow/third_party/py/python_configure.bzl", line 198, in _get_numpy_include
execute(repository_ctx, [python_bin, "-c", "from __future__ import print_function;import numpy; print(numpy.get_include());"], error_msg = "Problem getting numpy include path.", error_details = "Is numpy installed?").stdout.splitlines()
File "/home/mjcrouse/.cache/bazel/_bazel_mjcrouse/d4a5759ab5c8ecae004fbf3a12d053df/external/org_tensorflow/third_party/py/python_configure.bzl", line 187, in execute
execute(repository_ctx, <3 more arguments>)
File "/home/mjcrouse/.cache/bazel/_bazel_mjcrouse/d4a5759ab5c8ecae004fbf3a12d053df/external/org_tensorflow/third_party/remote_config/common.bzl", line 208, in execute
fail(<1 more arguments>)
Problem getting numpy include path.
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named numpy
Is numpy installed?
INFO: Repository rules_java instantiated at:
no stack (--record_rule_instantiation_callstack not enabled)
Repository rule http_archive defined at:
/home/mjcrouse/.cache/bazel/_bazel_mjcrouse/d4a5759ab5c8ecae004fbf3a12d053df/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in
ERROR: Analysis of target '//mediapipe/examples/desktop/hello_world:hello_world' failed; build aborted: Traceback (most recent call last):
File "/home/mjcrouse/.cache/bazel/_bazel_mjcrouse/d4a5759ab5c8ecae004fbf3a12d053df/external/org_tensorflow/third_party/py/python_configure.bzl", line 213
_get_numpy_include(<2 more arguments>)
File "/home/mjcrouse/.cache/bazel/_bazel_mjcrouse/d4a5759ab5c8ecae004fbf3a12d053df/external/org_tensorflow/third_party/py/python_configure.bzl", line 198, in _get_numpy_include
execute(repository_ctx, [python_bin, "-c", "from __future__ import print_function;import numpy; print(numpy.get_include());"], error_msg = "Problem getting numpy include path.", error_details = "Is numpy installed?").stdout.splitlines()
File "/home/mjcrouse/.cache/bazel/_bazel_mjcrouse/d4a5759ab5c8ecae004fbf3a12d053df/external/org_tensorflow/third_party/py/python_configure.bzl", line 187, in execute
execute(repository_ctx, <3 more arguments>)
File "/home/mjcrouse/.cache/bazel/_bazel_mjcrouse/d4a5759ab5c8ecae004fbf3a12d053df/external/org_tensorflow/third_party/remote_config/common.bzl", line 208, in execute
fail(<1 more arguments>)
Problem getting numpy include path.
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named numpy
Is numpy installed?
INFO: Elapsed time: 0.451s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets conf\
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets conf\
igured)
currently loading: @bazel_tools//tools/jdk

Most helpful comment

two commands, then it works
$ export PYTHON_BIN_PATH=/usr/bin/python3
$ sudo apt install python-numpy

All 5 comments

Solved my problem by running the 3 commands here. (Not sure if just getting numpy may have solved it)

https://qiita.com/mml/items/ea719b1edb722618271c

Solved my problem by running the 3 commands here. (Not sure if just getting numpy may have solved it)

https://qiita.com/mml/items/ea719b1edb722618271c

@mjcrouse thank you so much!!!
I have the same problem.
In my case only get numpy may not solved it.
But the problem have been solved after i run the 3 commands in link

I actually just did a very little thing and this problem was solved. I run:

export PYTHON_BIN_PATH=/usr/bin/python3

Because the error log mentioned: /root/.cache/bazel/_bazel_root/b5e57353465dda435d68680f86e74fc9/external/bazel_tools/tools/build_defs/repo/http.bzl

and opening this file, it reads:

python_configure depends on the following environment variables:

  • PYTHON_BIN_PATH: location of python binary.
  • PYTHON_LIB_PATH: Location of python libraries.
    """

So I tried my luck to set one of it and it worked.

Did a fresh install and that also worked for me. Thanks jianshuo

two commands, then it works
$ export PYTHON_BIN_PATH=/usr/bin/python3
$ sudo apt install python-numpy

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SwatiModi picture SwatiModi  路  5Comments

karfly picture karfly  路  3Comments

elblogbruno picture elblogbruno  路  4Comments

RealBBakGosu picture RealBBakGosu  路  4Comments

PrinceP picture PrinceP  路  5Comments