Preamble
OS X 10.13.6. Trying to install MediaPipe, using this guide, Mediapipe – Getting started – install – installing on macos. Installation failures when running:
$ bazel run --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hello_world:hello_world --verbose_failures
Each attempt results in a different linking error, there is no consistency.
This blog follows on from Course notes: Hand Tracking, which requires MediaPipe.
See also
Links
Apparently MediaPipe only works on Catalina 10.15.x and above, see:
- https://github.com/google/mediapipe/issues/477 and;
- https://github.com/google/mediapipe/issues/1984.
Failures
MediaPipe issues
In PyCharm, I got an installation fail on pip install mediapipe
, similar to the zbar
fail, in Course notes: QR and bar codes.
Using brew install mediapipe
didn’t help either.
Following this, https://google.github.io/mediapipe/getting_started/install.html#installing-on-macos, seems a bit of a bind, although there is not much to it:
- Download and install bazel-4.0.0-installer-darwin-x86_64.sh, from this guide, then install
chmod +x "bazel-${BAZEL_VERSION}-installer-darwin-x86_64.sh" ./bazel-${BAZEL_VERSION}-installer-darwin-x86_64.sh --user
You need to add ~/bin
to your path, and add the first line to .bash_profile
, for bash completion:
source /Users/macbook/.bazel/bin/bazel-complete.bash export PATH=/Users/<username>/bin:$PATH
- Ensure Python 3.7 and six are installed, from step 5
$ brew install python $ sudo ln -s -f /usr/local/bin/python3.7 /usr/local/bin/python $ python --version Python 3.7.4 $ pip3 install --user six
- Get mediapipe:
git clone https://github.com/google/mediapipe.git cd mediapipe
It is big, around 400 MB.
Then run hello world
export GLOG_logtostderr=1 bazel run --define MEDIAPIPE_DISABLE_GPU=1 \ mediapipe/examples/desktop/hello_world:hello_world
and that is about it.
However, I get an error upon each attempt, each time, with the linker failing on a different library:
-
libthrow_delegate.a
– also a tensorflow download warninglibdemangle_internal.a
– also a tensorflow download warninglibstatusor.a
libzlib.a
libflag.a
libint128.a
libint128.a
libzlib.a
libint128.a
libexponential_biased.a
Note that the first two attempts also has a tensorflow download warning, although these could have been related to a network issue.
The second and subsequent attempts use the --verbose-failures option
.
The full outputs are listed below:
Failure #1
This causes another long download and install… But it installs tensorflow, so it will probably fail… which it did:
$ bazel run --define MEDIAPIPE_DISABLE_GPU=1 \ > mediapipe/examples/desktop/hello_world:hello_world Starting local Bazel server and connecting to it... ... still trying to connect to local Bazel server after 10 seconds ... INFO: SHA256 (https://github.com/bazelbuild/rules_foreign_cc/archive/main.zip) = bbf9e0814ed107bdafa39a9034ce3796cc9e52751da7b208851501c9e064968c DEBUG: Rule 'rules_foreign_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "bbf9e0814ed107bdafa39a9034ce3796cc9e52751da7b208851501c9e064968c" DEBUG: Repository rules_foreign_cc instantiated at: /Users/macbook/mediapipe/WORKSPACE:39:13: in Repository rule http_archive defined at: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/rules_foreign_cc/workspace_definitions.bzl:6:6: `@rules_foreign_cc//:workspace_definitions.bzl` has been replaced by `@rules_foreign_cc//foreign_cc:repositories.bzl`. Please use the updated source location WARNING: Download from http://mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/cf1e44edb908e9616030cc83d085989b8e6cd6df.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found INFO: SHA256 (https://github.com/bazelbuild/rules_cc/archive/master.zip) = 39530432fdce0eda8e78d179330ff454f6cbec8973ab7310aab335460a9f06f6 DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "39530432fdce0eda8e78d179330ff454f6cbec8973ab7310aab335460a9f06f6" DEBUG: Repository rules_cc instantiated at: /Users/macbook/mediapipe/WORKSPACE:33:13: in Repository rule http_archive defined at: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/rules_foreign_cc/tools/build_defs/deprecation.bzl:5:10: `@rules_foreign_cc//tools/build_defs/...` is deprecated, please find the relevant symbols in `@rules_foreign_cc//foreign_cc/...`. Note that the core rules can now be loaded from `@rules_foreign_cc//foreign_cc:defs.bzl` INFO: Analyzed target //mediapipe/examples/desktop/hello_world:hello_world (59 packages loaded, 1364 targets configured). INFO: Found 1 target... ERROR: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/com_google_absl/absl/base/BUILD.bazel:284:11: Linking external/com_google_absl/absl/base/libthrow_delegate.a failed: (Exit 1): libtool failed: error executing command /usr/bin/libtool @bazel-out/darwin-fastbuild/bin/external/com_google_absl/absl/base/libthrow_delegate.a-2.params Use --sandbox_debug to see verbose messages from the sandbox libtool failed: error executing command /usr/bin/libtool @bazel-out/darwin-fastbuild/bin/external/com_google_absl/absl/base/libthrow_delegate.a-2.params Use --sandbox_debug to see verbose messages from the sandbox error: /Library/Developer/CommandLineTools/usr/bin/libtool: no output file specified (specify with -o output) Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols] Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table ] [-seg_addr_table_filename ] [-all_load] [-noall_load] Target //mediapipe/examples/desktop/hello_world:hello_world failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 413.969s, Critical Path: 130.76s INFO: 568 processes: 421 internal, 147 darwin-sandbox. FAILED: Build did NOT complete successfully FAILED: Build did NOT complete successfully
First, the tensorflow download failed warning(rules_closure
), and then there is a linking error (libthrow_delegate.a
).
Failure #2
Running it again,, gave a libdemangle_internal.a
error:
$ bazel run --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hello_world:hello_world --verbose_failures DEBUG: Rule 'rules_foreign_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "bbf9e0814ed107bdafa39a9034ce3796cc9e52751da7b208851501c9e064968c" DEBUG: Repository rules_foreign_cc instantiated at: /Users/macbook/mediapipe/WORKSPACE:39:13: in Repository rule http_archive defined at: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/rules_foreign_cc/workspace_definitions.bzl:6:6: `@rules_foreign_cc//:workspace_definitions.bzl` has been replaced by `@rules_foreign_cc//foreign_cc:repositories.bzl`. Please use the updated source location WARNING: Download from http://mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/cf1e44edb908e9616030cc83d085989b8e6cd6df.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "39530432fdce0eda8e78d179330ff454f6cbec8973ab7310aab335460a9f06f6" DEBUG: Repository rules_cc instantiated at: /Users/macbook/mediapipe/WORKSPACE:33:13: in Repository rule http_archive defined at: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/rules_foreign_cc/tools/build_defs/deprecation.bzl:5:10: `@rules_foreign_cc//tools/build_defs/...` is deprecated, please find the relevant symbols in `@rules_foreign_cc//foreign_cc/...`. Note that the core rules can now be loaded from `@rules_foreign_cc//foreign_cc:defs.bzl` INFO: Analyzed target //mediapipe/examples/desktop/hello_world:hello_world (0 packages loaded, 0 targets configured). INFO: Found 1 target... ERROR: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/com_google_absl/absl/debugging/BUILD.bazel:188:11: Linking external/com_google_absl/absl/debugging/libdemangle_internal.a failed: (Exit 1): libtool failed: error executing command (cd /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/sandbox/darwin-sandbox/276/execroot/mediapipe && \ exec env - \ PATH='/Users/macbook/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin' \ PWD=/proc/self/cwd \ /usr/bin/libtool @bazel-out/darwin-fastbuild/bin/external/com_google_absl/absl/debugging/libdemangle_internal.a-2.params) Execution platform: @local_execution_config_platform//:platform Use --sandbox_debug to see verbose messages from the sandbox libtool failed: error executing command (cd /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/sandbox/darwin-sandbox/276/execroot/mediapipe && \ exec env - \ PATH='/Users/macbook/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin' \ PWD=/proc/self/cwd \ /usr/bin/libtool @bazel-out/darwin-fastbuild/bin/external/com_google_absl/absl/debugging/libdemangle_internal.a-2.params) Execution platform: @local_execution_config_platform//:platform Use --sandbox_debug to see verbose messages from the sandbox error: /Library/Developer/CommandLineTools/usr/bin/libtool: no output file specified (specify with -o output) Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols] Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table ] [-seg_addr_table_filename ] [-all_load] [-noall_load] Target //mediapipe/examples/desktop/hello_world:hello_world failed to build INFO: Elapsed time: 3.820s, Critical Path: 0.95s INFO: 147 processes: 147 internal. FAILED: Build did NOT complete successfully FAILED: Build did NOT complete successfully $
I gave up at this point.
However, this issue seems to be mentioned in the MediaPipe install guide: Fail to fetch remote dependency repositories:
The error message:
ERROR: An error occurred during the fetch of repository 'org_tensorflow': java.io.IOException: Error downloading [https://mirror.bazel.build/github.com/tensorflow/tensorflow/archive/77e9ffb9b2bfb1a4f7056e62d84039626923e328.tar.gz, https://github.com/tensorflow/tensorflow/archive/77e9ffb9b2bfb1a4f7056e62d84039626923e328.tar.gz] to /sandbox_path/external/org_tensorflow/77e9ffb9b2bfb1a4f7056e62d84039626923e328.tar.gz: Tried to reconnect at offset 9,944,151 but server didn't support it or WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_swift/releases/download/0.12.1/rules_swift.0.12.1.tar.gz failed: class java.net.ConnectException Connection timed out (Connection timed out)
usually indicates that Bazel fails to download necessary dependency repositories that MediaPipe needs. MedaiPipe has several dependency repositories that are hosted by Google sites. In some regions, you may need to set up a network proxy or use a VPN to access those resources. You may also need to append
--host_jvm_args "-DsocksProxyHost=<ip address> -DsocksProxyPort=<port number>"
to the Bazel command. See this GitHub issue for more details.If you believe that it’s not a network issue, another possibility is that some resources could be temporarily unavailable, please run
bazel clean --expunge
and retry it later. If it’s still not working, please file a GitHub issue with the detailed error message.
Failure #3
Strangely, the next day, after clean –expunge and running again I got a different linking failure (libstatusor.a
), without the tensorflow download warning:
bazel clean --expunge Starting local Bazel server and connecting to it... ... still trying to connect to local Bazel server after 10 seconds ... INFO: Starting clean. $ bazel run --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hello_world:hello_world --verbose_failures Starting local Bazel server and connecting to it... INFO: SHA256 (https://github.com/bazelbuild/rules_foreign_cc/archive/main.zip) = d8a6c747e10f745a7a3136cd5e242bde36bc1076e2169ef4560d1b4baf67ecc7 DEBUG: Rule 'rules_foreign_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "d8a6c747e10f745a7a3136cd5e242bde36bc1076e2169ef4560d1b4baf67ecc7" DEBUG: Repository rules_foreign_cc instantiated at: /Users/macbook/mediapipe/WORKSPACE:39:13: in Repository rule http_archive defined at: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/rules_foreign_cc/workspace_definitions.bzl:6:6: `@rules_foreign_cc//:workspace_definitions.bzl` has been replaced by `@rules_foreign_cc//foreign_cc:repositories.bzl`. Please use the updated source location INFO: SHA256 (https://github.com/bazelbuild/rules_cc/archive/master.zip) = 39530432fdce0eda8e78d179330ff454f6cbec8973ab7310aab335460a9f06f6 DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "39530432fdce0eda8e78d179330ff454f6cbec8973ab7310aab335460a9f06f6" DEBUG: Repository rules_cc instantiated at: /Users/macbook/mediapipe/WORKSPACE:33:13: in Repository rule http_archive defined at: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/rules_foreign_cc/tools/build_defs/deprecation.bzl:5:10: `@rules_foreign_cc//tools/build_defs/...` is deprecated, please find the relevant symbols in `@rules_foreign_cc//foreign_cc/...`. Note that the core rules can now be loaded from `@rules_foreign_cc//foreign_cc:defs.bzl` INFO: Analyzed target //mediapipe/examples/desktop/hello_world:hello_world (59 packages loaded, 1364 targets configured). INFO: Found 1 target... ERROR: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/com_google_absl/absl/status/BUILD.bazel:69:11: Linking external/com_google_absl/absl/status/libstatusor.a failed: (Exit 1): libtool failed: error executing command (cd /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/sandbox/darwin-sandbox/188/execroot/mediapipe && \ exec env - \ PATH='/Users/macbook/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin' \ PWD=/proc/self/cwd \ /usr/bin/libtool @bazel-out/darwin-fastbuild/bin/external/com_google_absl/absl/status/libstatusor.a-2.params) Execution platform: @local_execution_config_platform//:platform Use --sandbox_debug to see verbose messages from the sandbox libtool failed: error executing command (cd /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/sandbox/darwin-sandbox/188/execroot/mediapipe && \ exec env - \ PATH='/Users/macbook/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin' \ PWD=/proc/self/cwd \ /usr/bin/libtool @bazel-out/darwin-fastbuild/bin/external/com_google_absl/absl/status/libstatusor.a-2.params) Execution platform: @local_execution_config_platform//:platform Use --sandbox_debug to see verbose messages from the sandbox error: /Library/Developer/CommandLineTools/usr/bin/libtool: no output file specified (specify with -o output) Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols] Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table ] [-seg_addr_table_filename ] [-all_load] [-noall_load] Target //mediapipe/examples/desktop/hello_world:hello_world failed to build INFO: Elapsed time: 459.702s, Critical Path: 225.48s INFO: 537 processes: 353 internal, 184 darwin-sandbox. FAILED: Build did NOT complete successfully FAILED: Build did NOT complete successfully
Failure #4
Another run, 5 minutes later, and a different linking error (libzlib.a
)! Is there no reproducibility?
$ bazel clean --expunge INFO: Starting clean. $ bazel run --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hello_world:hello_world --verbose_failures Starting local Bazel server and connecting to it... INFO: SHA256 (https://github.com/bazelbuild/rules_foreign_cc/archive/main.zip) = d8a6c747e10f745a7a3136cd5e242bde36bc1076e2169ef4560d1b4baf67ecc7 DEBUG: Rule 'rules_foreign_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "d8a6c747e10f745a7a3136cd5e242bde36bc1076e2169ef4560d1b4baf67ecc7" DEBUG: Repository rules_foreign_cc instantiated at: /Users/macbook/mediapipe/WORKSPACE:39:13: in Repository rule http_archive defined at: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/rules_foreign_cc/workspace_definitions.bzl:6:6: `@rules_foreign_cc//:workspace_definitions.bzl` has been replaced by `@rules_foreign_cc//foreign_cc:repositories.bzl`. Please use the updated source location INFO: SHA256 (https://github.com/bazelbuild/rules_cc/archive/master.zip) = 39530432fdce0eda8e78d179330ff454f6cbec8973ab7310aab335460a9f06f6 DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "39530432fdce0eda8e78d179330ff454f6cbec8973ab7310aab335460a9f06f6" DEBUG: Repository rules_cc instantiated at: /Users/macbook/mediapipe/WORKSPACE:33:13: in Repository rule http_archive defined at: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/rules_foreign_cc/tools/build_defs/deprecation.bzl:5:10: `@rules_foreign_cc//tools/build_defs/...` is deprecated, please find the relevant symbols in `@rules_foreign_cc//foreign_cc/...`. Note that the core rules can now be loaded from `@rules_foreign_cc//foreign_cc:defs.bzl` INFO: Analyzed target //mediapipe/examples/desktop/hello_world:hello_world (59 packages loaded, 1364 targets configured). INFO: Found 1 target... ERROR: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/zlib/BUILD.bazel:5:11: Linking external/zlib/libzlib.a [for host] failed: (Exit 1): libtool failed: error executing command (cd /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/sandbox/darwin-sandbox/150/execroot/mediapipe && \ exec env - \ PATH='/Users/macbook/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin' \ PWD=/proc/self/cwd \ /usr/bin/libtool @bazel-out/host/bin/external/zlib/libzlib.a-2.params) Execution platform: @local_execution_config_platform//:platform Use --sandbox_debug to see verbose messages from the sandbox libtool failed: error executing command (cd /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/sandbox/darwin-sandbox/150/execroot/mediapipe && \ exec env - \ PATH='/Users/macbook/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin' \ PWD=/proc/self/cwd \ /usr/bin/libtool @bazel-out/host/bin/external/zlib/libzlib.a-2.params) Execution platform: @local_execution_config_platform//:platform Use --sandbox_debug to see verbose messages from the sandbox error: /Library/Developer/CommandLineTools/usr/bin/libtool: no output file specified (specify with -o output) Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols] Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table ] [-seg_addr_table_filename ] [-all_load] [-noall_load] Target //mediapipe/examples/desktop/hello_world:hello_world failed to build INFO: Elapsed time: 408.745s, Critical Path: 191.15s INFO: 471 processes: 323 internal, 148 darwin-sandbox. FAILED: Build did NOT complete successfully FAILED: Build did NOT complete successfully $
What the f—? Four runs and four different errors!
Failure #5
Then libflag.a
:
$ bazel clean --expunge INFO: Starting clean. $ bazel run --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hello_world:hello_world --verbose_failures Starting local Bazel server and connecting to it... INFO: SHA256 (https://github.com/bazelbuild/rules_foreign_cc/archive/main.zip) = d8a6c747e10f745a7a3136cd5e242bde36bc1076e2169ef4560d1b4baf67ecc7 DEBUG: Rule 'rules_foreign_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "d8a6c747e10f745a7a3136cd5e242bde36bc1076e2169ef4560d1b4baf67ecc7" DEBUG: Repository rules_foreign_cc instantiated at: /Users/macbook/mediapipe/WORKSPACE:39:13: in Repository rule http_archive defined at: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/rules_foreign_cc/workspace_definitions.bzl:6:6: `@rules_foreign_cc//:workspace_definitions.bzl` has been replaced by `@rules_foreign_cc//foreign_cc:repositories.bzl`. Please use the updated source location INFO: SHA256 (https://github.com/bazelbuild/rules_cc/archive/master.zip) = 39530432fdce0eda8e78d179330ff454f6cbec8973ab7310aab335460a9f06f6 DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "39530432fdce0eda8e78d179330ff454f6cbec8973ab7310aab335460a9f06f6" DEBUG: Repository rules_cc instantiated at: /Users/macbook/mediapipe/WORKSPACE:33:13: in Repository rule http_archive defined at: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/rules_foreign_cc/tools/build_defs/deprecation.bzl:5:10: `@rules_foreign_cc//tools/build_defs/...` is deprecated, please find the relevant symbols in `@rules_foreign_cc//foreign_cc/...`. Note that the core rules can now be loaded from `@rules_foreign_cc//foreign_cc:defs.bzl` INFO: Analyzed target //mediapipe/examples/desktop/hello_world:hello_world (59 packages loaded, 1364 targets configured). INFO: Found 1 target... ERROR: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/com_google_absl/absl/flags/BUILD.bazel:216:11: Linking external/com_google_absl/absl/flags/libflag.a failed: (Exit 1): libtool failed: error executing command (cd /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/sandbox/darwin-sandbox/156/execroot/mediapipe && \ exec env - \ PATH='/Users/macbook/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin' \ PWD=/proc/self/cwd \ /usr/bin/libtool @bazel-out/darwin-fastbuild/bin/external/com_google_absl/absl/flags/libflag.a-2.params) Execution platform: @local_execution_config_platform//:platform Use --sandbox_debug to see verbose messages from the sandbox libtool failed: error executing command (cd /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/sandbox/darwin-sandbox/156/execroot/mediapipe && \ exec env - \ PATH='/Users/macbook/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin' \ PWD=/proc/self/cwd \ /usr/bin/libtool @bazel-out/darwin-fastbuild/bin/external/com_google_absl/absl/flags/libflag.a-2.params) Execution platform: @local_execution_config_platform//:platform Use --sandbox_debug to see verbose messages from the sandbox error: /Library/Developer/CommandLineTools/usr/bin/libtool: no output file specified (specify with -o output) Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols] Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table ] [-seg_addr_table_filename ] [-all_load] [-noall_load] Target //mediapipe/examples/desktop/hello_world:hello_world failed to build INFO: Elapsed time: 343.598s, Critical Path: 124.29s INFO: 508 processes: 354 internal, 154 darwin-sandbox. FAILED: Build did NOT complete successfully FAILED: Build did NOT complete successfully $
Incredible. Literally unbelievable…
Failure # 6
This time the linker failed on libint128.a
failed
$ bazel clean --expunge Starting local Bazel server and connecting to it... ... still trying to connect to local Bazel server after 10 seconds ... INFO: Starting clean. $ bazel run --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hello_world:hello_world --verbose_failures Starting local Bazel server and connecting to it... INFO: SHA256 (https://github.com/bazelbuild/rules_foreign_cc/archive/main.zip) = d8a6c747e10f745a7a3136cd5e242bde36bc1076e2169ef4560d1b4baf67ecc7 DEBUG: Rule 'rules_foreign_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "d8a6c747e10f745a7a3136cd5e242bde36bc1076e2169ef4560d1b4baf67ecc7" DEBUG: Repository rules_foreign_cc instantiated at: /Users/macbook/mediapipe/WORKSPACE:39:13: in Repository rule http_archive defined at: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/rules_foreign_cc/workspace_definitions.bzl:6:6: `@rules_foreign_cc//:workspace_definitions.bzl` has been replaced by `@rules_foreign_cc//foreign_cc:repositories.bzl`. Please use the updated source location INFO: SHA256 (https://github.com/bazelbuild/rules_cc/archive/master.zip) = 39530432fdce0eda8e78d179330ff454f6cbec8973ab7310aab335460a9f06f6 DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "39530432fdce0eda8e78d179330ff454f6cbec8973ab7310aab335460a9f06f6" DEBUG: Repository rules_cc instantiated at: /Users/macbook/mediapipe/WORKSPACE:33:13: in Repository rule http_archive defined at: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/rules_foreign_cc/tools/build_defs/deprecation.bzl:5:10: `@rules_foreign_cc//tools/build_defs/...` is deprecated, please find the relevant symbols in `@rules_foreign_cc//foreign_cc/...`. Note that the core rules can now be loaded from `@rules_foreign_cc//foreign_cc:defs.bzl` INFO: Analyzed target //mediapipe/examples/desktop/hello_world:hello_world (59 packages loaded, 1364 targets configured). INFO: Found 1 target... ERROR: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/com_google_absl/absl/numeric/BUILD.bazel:27:11: Linking external/com_google_absl/absl/numeric/libint128.a failed: (Exit 1): libtool failed: error executing command (cd /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/sandbox/darwin-sandbox/161/execroot/mediapipe && \ exec env - \ PATH='/Users/macbook/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin' \ PWD=/proc/self/cwd \ /usr/bin/libtool @bazel-out/darwin-fastbuild/bin/external/com_google_absl/absl/numeric/libint128.a-2.params) Execution platform: @local_execution_config_platform//:platform Use --sandbox_debug to see verbose messages from the sandbox libtool failed: error executing command (cd /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/sandbox/darwin-sandbox/161/execroot/mediapipe && \ exec env - \ PATH='/Users/macbook/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin' \ PWD=/proc/self/cwd \ /usr/bin/libtool @bazel-out/darwin-fastbuild/bin/external/com_google_absl/absl/numeric/libint128.a-2.params) Execution platform: @local_execution_config_platform//:platform Use --sandbox_debug to see verbose messages from the sandbox error: /Library/Developer/CommandLineTools/usr/bin/libtool: no output file specified (specify with -o output) Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols] Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table ] [-seg_addr_table_filename ] [-all_load] [-noall_load] Target //mediapipe/examples/desktop/hello_world:hello_world failed to build INFO: Elapsed time: 345.452s, Critical Path: 136.62s INFO: 500 processes: 342 internal, 158 darwin-sandbox. FAILED: Build did NOT complete successfully FAILED: Build did NOT complete successfully $
Failure # 10
libexponential_biased.a
$ bazel clean --expunge INFO: Starting clean. $ bazel run --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hello_world:hello_world --verbose_failures Starting local Bazel server and connecting to it... INFO: SHA256 (https://github.com/bazelbuild/rules_foreign_cc/archive/main.zip) = d8a6c747e10f745a7a3136cd5e242bde36bc1076e2169ef4560d1b4baf67ecc7 DEBUG: Rule 'rules_foreign_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "d8a6c747e10f745a7a3136cd5e242bde36bc1076e2169ef4560d1b4baf67ecc7" DEBUG: Repository rules_foreign_cc instantiated at: /Users/macbook/mediapipe/WORKSPACE:39:13: in Repository rule http_archive defined at: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/rules_foreign_cc/workspace_definitions.bzl:6:6: `@rules_foreign_cc//:workspace_definitions.bzl` has been replaced by `@rules_foreign_cc//foreign_cc:repositories.bzl`. Please use the updated source location INFO: SHA256 (https://github.com/bazelbuild/rules_cc/archive/master.zip) = 39530432fdce0eda8e78d179330ff454f6cbec8973ab7310aab335460a9f06f6 DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "39530432fdce0eda8e78d179330ff454f6cbec8973ab7310aab335460a9f06f6" DEBUG: Repository rules_cc instantiated at: /Users/macbook/mediapipe/WORKSPACE:33:13: in Repository rule http_archive defined at: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/rules_foreign_cc/tools/build_defs/deprecation.bzl:5:10: `@rules_foreign_cc//tools/build_defs/...` is deprecated, please find the relevant symbols in `@rules_foreign_cc//foreign_cc/...`. Note that the core rules can now be loaded from `@rules_foreign_cc//foreign_cc:defs.bzl` INFO: Analyzed target //mediapipe/examples/desktop/hello_world:hello_world (59 packages loaded, 1364 targets configured). INFO: Found 1 target... ERROR: /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/external/com_google_absl/absl/base/BUILD.bazel:614:11: Linking external/com_google_absl/absl/base/libexponential_biased.a failed: (Exit 1): libtool failed: error executing command (cd /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/sandbox/darwin-sandbox/136/execroot/mediapipe && \ exec env - \ PATH='/Users/macbook/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin' \ PWD=/proc/self/cwd \ /usr/bin/libtool @bazel-out/darwin-fastbuild/bin/external/com_google_absl/absl/base/libexponential_biased.a-2.params) Execution platform: @local_execution_config_platform//:platform Use --sandbox_debug to see verbose messages from the sandbox libtool failed: error executing command (cd /private/var/tmp/_bazel_macbook/20f5790df9df632ec488e67f4fad7cad/sandbox/darwin-sandbox/136/execroot/mediapipe && \ exec env - \ PATH='/Users/macbook/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin' \ PWD=/proc/self/cwd \ /usr/bin/libtool @bazel-out/darwin-fastbuild/bin/external/com_google_absl/absl/base/libexponential_biased.a-2.params) Execution platform: @local_execution_config_platform//:platform Use --sandbox_debug to see verbose messages from the sandbox error: /Library/Developer/CommandLineTools/usr/bin/libtool: no output file specified (specify with -o output) Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols] Usage: /Library/Developer/CommandLineTools/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table ] [-seg_addr_table_filename ] [-all_load] [-noall_load] Target //mediapipe/examples/desktop/hello_world:hello_world failed to build INFO: Elapsed time: 416.030s, Critical Path: 158.78s INFO: 508 processes: 375 internal, 133 darwin-sandbox. FAILED: Build did NOT complete successfully FAILED: Build did NOT complete successfully $
blah
Python version
Using a different approach, from here, https://github.com/google/mediapipe/issues/1466, mediapipe doesn’t support Python 3.9, only 3.6-3.9. However, my pip (I actually only have pip3) is 3.9:
$ ls -al /usr/local/bin/pip3 lrwxr-xr-x 1 macbook admin 37 Mar 1 05:12 /usr/local/bin/pip3 -> ../Cellar/python@3.9/3.9.2_1/bin/pip3 $ ls -al /usr/local/bin/pip3* lrwxr-xr-x 1 macbook admin 37 Mar 1 05:12 /usr/local/bin/pip3 -> ../Cellar/python@3.9/3.9.2_1/bin/pip3 lrwxr-xr-x 1 macbook admin 39 Mar 1 05:12 /usr/local/bin/pip3.9 -> ../Cellar/python@3.9/3.9.2_1/bin/pip3.9
So symlinking pip
to 3.7
$ ln -s /usr/local/Cellar/python\@3.7/3.7.10_2/bin/pip3 /usr/local/bin/pip
and adding a symlink for python 3.7 too, which previously wasn’t in /usr/local/bin
(I had 2.7 in /usr/bin
)
$ which python /usr/bin/python $ python --version Python 2.7.16 ... $ ln -s /usr/local/Cellar/python\@3.7/3.7.10_2/bin/python3.7 /usr/local/bin/python
However, I still got the same error:
$ pip install mediapipe ERROR: Could not find a version that satisfies the requirement mediapipe ERROR: No matching distribution found for mediapipe
Maybe I need to change the /usr/local/bin/pip3
symlink, which currently points to 3.9?
Docker
There is also a Docker install for mediapipe, see Installing using Docker. See also Docker for High Sierra. This could also fix the tensorflow issues, see Tensorflow crashes on OSX.
However, when running “bazel hello world”, I got the exact same tensorflow rules_closure
download failure as for the native OS X install above. However, I didn’t get the libthrow_delegate.a
error (or any errors for that matter) and the hello world example did actually run:
$ docker run -it --name mediapipe mediapipe:latest root@05a68a83dbd9:/mediapipe# GLOG_logtostderr=1 bazel run --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hello_world:hello_world Extracting Bazel installation... Starting local Bazel server and connecting to it... INFO: SHA256 (https://github.com/bazelbuild/rules_foreign_cc/archive/main.zip) = d8a6c747e10f745a7a3136cd5e242bde36bc1076e2169ef4560d1b4baf67ecc7 DEBUG: Rule 'rules_foreign_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "d8a6c747e10f745a7a3136cd5e242bde36bc1076e2169ef4560d1b4baf67ecc7" DEBUG: Repository rules_foreign_cc instantiated at: no stack (--record_rule_instantiation_callstack not enabled) Repository rule http_archive defined at: /root/.cache/bazel/_bazel_root/4884d566396e9b67b62185751879ad14/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: /root/.cache/bazel/_bazel_root/4884d566396e9b67b62185751879ad14/external/rules_foreign_cc/workspace_definitions.bzl:6:6: `@rules_foreign_cc//:workspace_definitions.bzl` has been replaced by `@rules_foreign_cc//foreign_cc:repositories.bzl`. Please use the updated source location WARNING: Download from http://mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/cf1e44edb908e9616030cc83d085989b8e6cd6df.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found INFO: SHA256 (https://github.com/bazelbuild/rules_cc/archive/master.zip) = 39530432fdce0eda8e78d179330ff454f6cbec8973ab7310aab335460a9f06f6 DEBUG: Rule 'rules_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "39530432fdce0eda8e78d179330ff454f6cbec8973ab7310aab335460a9f06f6" DEBUG: Repository rules_cc instantiated at: no stack (--record_rule_instantiation_callstack not enabled) Repository rule http_archive defined at: /root/.cache/bazel/_bazel_root/4884d566396e9b67b62185751879ad14/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in DEBUG: /root/.cache/bazel/_bazel_root/4884d566396e9b67b62185751879ad14/external/rules_foreign_cc/tools/build_defs/deprecation.bzl:5:10: `@rules_foreign_cc//tools/build_defs/...` is deprecated, please find the relevant symbols in `@rules_foreign_cc//foreign_cc/...`. Note that the core rules can now be loaded from `@rules_foreign_cc//foreign_cc:defs.bzl` INFO: Analyzed target //mediapipe/examples/desktop/hello_world:hello_world (57 packages loaded, 1352 targets configured). INFO: Found 1 target... INFO: From ProtoCompile mediapipe/calculators/internal/callback_packet_calculator.pb.h: bazel-out/k8-fastbuild/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/framework/calculator_profile.pb.h: bazel-out/k8-fastbuild/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/framework/tool/calculator_graph_template.pb.h: bazel-out/k8-fastbuild/bin/external/com_google_protobuf/src: warning: directory does not exist. INFO: From ProtoCompile mediapipe/framework/calculator.pb.h: bazel-out/k8-fastbuild/bin/external/com_google_protobuf/src: warning: directory does not exist. Target //mediapipe/examples/desktop/hello_world:hello_world up-to-date: bazel-bin/mediapipe/examples/desktop/hello_world/hello_world INFO: Elapsed time: 788.661s, Critical Path: 374.25s INFO: 467 processes: 467 processwrapper-sandbox. INFO: Build completed successfully, 483 total actions INFO: Build completed successfully, 483 total actions I20210327 20:11:47.024367 9 hello_world.cc:56] Hello World! I20210327 20:11:47.062677 9 hello_world.cc:56] Hello World! I20210327 20:11:47.062758 9 hello_world.cc:56] Hello World! I20210327 20:11:47.062839 9 hello_world.cc:56] Hello World! I20210327 20:11:47.062922 9 hello_world.cc:56] Hello World! I20210327 20:11:47.062964 9 hello_world.cc:56] Hello World! I20210327 20:11:47.063261 9 hello_world.cc:56] Hello World! I20210327 20:11:47.063356 9 hello_world.cc:56] Hello World! I20210327 20:11:47.063443 9 hello_world.cc:56] Hello World! I20210327 20:11:47.063522 9 hello_world.cc:56] Hello World! root@05a68a83dbd9:/mediapipe#
This is the end, my friend.