mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

build error on windows

Open ChesterXcw opened this issue 3 years ago • 8 comments

Please make sure that this is a build/installation issue and also refer to the troubleshooting documentation before raising any issues.

System information (Please provide as much relevant information as possible)

  • OS Platform and Distribution: Windows 10
  • Bazel version:bazel 6.0.0-pre.20220706.4
  • OpenCV version: 3.4.16

Describe the problem: When ran the follow command on windows, errors occured! I followed the official document Can not find any solutions

command as follows: bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --action_env PYTHON_BIN_PATH="C://Users//user//AppData//Local//Programs//Python//Python38//python.exe" mediapipe/examples/desktop/hello_world --verbose_failures

Complete Logs:

Warning: skipping import of repository 'com_google_absl' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_google_benchmark' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'pybind11_bazel' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_google_protobuf' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_google_googletest' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'build_bazel_apple_support' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'xctestrunner' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'pybind11' because it already exists.
WARNING: E:/git/mediapipe/mediapipe/framework/tool/BUILD:184:24: in cc_library rule //mediapipe/framework/tool:field_data_cc_proto: target '//mediapipe/framework/tool:field_data_cc_proto' depends on deprecated target '@com_google_protobuf//:cc_wkt_protos': Only for backward compatibility. Do not use.
WARNING: E:/git/mediapipe/mediapipe/framework/BUILD:54:24: in cc_library rule //mediapipe/framework:calculator_cc_proto: target '//mediapipe/framework:calculator_cc_proto' depends on deprecated target '@com_google_protobuf//:cc_wkt_protos': Only for backward compatibility. Do not use.
INFO: Analyzed target //mediapipe/examples/desktop/hello_world:hello_world (77 packages loaded, 1644 targets configured). 
INFO: Found 1 target...
ERROR: C:/users/user/_bazel_user/7he4j6fx/external/com_github_gflags_gflags/BUILD:16:30: Executing genrule @com_github_gflags_gflags//:gflags_completions_h failed: (Exit -1): bash.exe failed: error executing command (from target @com_github_gflags_gflags//:gflags_completions_h)
  cd /d C:/users/user/_bazel_user/7he4j6fx/execroot/mediapipe
  SET PATH=D:\Download\msys2\usr\bin;D:\Download\msys2\bin;C:\Windows;C:\Windows\System32;C:\Windows\System32\WindowsPowerShell\v1.0;C:\ProgramData\Miniconda3\condabin;C:\Program Files\Eclipse Foundation\jdk-8.0.302.8-hotspot\bin;C:\ProgramData\Miniconda3;C:\ProgramData\Miniconda3\Library\mingw-w64\bin;C:\ProgramData\Miniconda3\Library\usr\bin;C:\ProgramData\Miniconda3\Library\bin;C:\ProgramData\Miniconda3\Scripts;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Users\user\.conda\envs\gluon\python.exe;C:\Users\user\AppData\Local\Programs\Python\Python38;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\Java\jdk1.8.0_301\jre\bin;C:\Program Files\Java\jdk1.8.0_301\bin;C:\Users\user\AppData\Local\Programs\Python\Python38\Scripts;D:\wechant\WeChat Files\wxid_lvdivrqhp0or22\FileStorage\File\2020-12\adb;C:\Program Files\Git\cmd;C:\Program Files (x86)\NetSarang\Xftp 7;";C:\Users\user\AppData\Local\Android\Sdk\platform-tools";C:\Users\user\AppData\Local\Android\Sdk\tools;C:\Program Files\Pandoc;C:\Program Files\Pandoc;D:\Download\miktex\miktex\bin\x64;D:\Download\mingw64\bin;D:\software_download\opencv\build\x64\vc15\bin;C:\Program 
Files (x86)\ZeroTier\One;D:\Download\aws\aws.exe;D:\Download\msys2;D:\software_download\ADB;D:\Download\Windows Kits\10\Windows Performance Toolkit;D:\Download\bazel;.;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Users\user\AppData\Local\Microsoft\WindowsApps;.;C:\Program Files\JetBrains\PyCharm 2019.3.5\bin;.;D:\software_download\Microsoft VS Code\bin;C:\Users\user\AppData\Local\Programs\EmEditor
    SET PYTHON_BIN_PATH=C://Users//user//AppData//Local//Programs//Python//Python38//python.exe
    SET RUNFILES_MANIFEST_ONLY=1
  c:\tools\msys64\usr\bin\bash.exe -c source external/bazel_tools/tools/genrule/genrule-setup.sh; awk '{ gsub(/@GFLAGS_NAMESPACE@/, "gflags"); print; }' external/com_github_gflags_gflags/src/gflags_completions.h.in > bazel-out/x64_windows-opt/bin/external/com_github_gflags_gflags/gflags_completions.h
# Configuration: ce3e511dac9a3981268d5d2f47530c03177288dffdbebf42b047ccf313c60ef3
# Execution platform: @local_execution_config_platform//:platform
Action failed to execute: java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("c:\tools\msys64\usr\bin\bash.exe" -c "source external/bazel_tools/tools/genrule/genrule-setup.sh; awk '{ gsub(/@GFLAGS_NAMESPACE@/, \"gflags\"); print; }' external/com_github_gflags_gflags/src/gflags_completions.h.in > bazel-out/x64_windows-opt/bin/external/com_github_gflags_gflags/gflags_completions.h"): 绯荤粺鎵句笉鍒版寚瀹氱殑鏂囦欢銆?
 (error: 2)
Target //mediapipe/examples/desktop/hello_world:hello_world failed to build
INFO: Elapsed time: 1.956s, Critical Path: 0.10s
INFO: 34 processes: 34 internal.
FAILED: Build did NOT complete successfully ```  


ChesterXcw avatar Aug 01 '22 08:08 ChesterXcw

Hi @ChesterXcw, It seems an error is occurring because Mediapipe is trying to access the MSYS2 folder at the wrong path. Could you try the below steps to make it in the correct path:

  • Create a new folder called tools in C:\ directory.
  • Move the msys2 folder from D:\Download\msys2 to the previously created tools folder in C:\ directory.
  • Rename the folder name from msys2 to msys64.

Please let us know if this resolves the issue. Thank you!

kuaashish avatar Aug 01 '22 09:08 kuaashish

Hi @ChesterXcw, Could you please let us know this is still an issue or resolved as per the above comment. Thank you!

kuaashish avatar Aug 05 '22 05:08 kuaashish

Oh, so sorry ,I forget it!

May be it works , I followed your advice, the above question never happened , but an new error occured!

The same as "Missing Python binary path", even if I specified the python path. when I refer to the troubleshooting, it does not work,

And now , I am trying to install on docker, but I will try again later on Windows.

should i need to reinstall the mysy?

Thanks a lot !

ChesterXcw avatar Aug 05 '22 06:08 ChesterXcw

Hi @ChesterXcwm, Could you please share the "Missing Python binary path" complete error log to investigate it further. Thank you!

kuaashish avatar Aug 05 '22 07:08 kuaashish

OK

(pose) E:\git\mediapipe>bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 --action_env PYTHON_BIN_PATH="C:/Users/user/.conda/envs/pose/python.exe"  mediapipe/examples/desktop/hello_world  
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_google_absl' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_google_benchmark' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'pybind11_bazel' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_google_protobuf' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_google_googletest' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'build_bazel_apple_support' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'xctestrunner' because it already exists.
DEBUG: C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/repo.bzl:124:14:
Warning: skipping import of repository 'pybind11' because it already exists.
INFO: Build option --action_env has changed, discarding analysis cache.
INFO: Repository local_execution_config_python instantiated at:
  E:/git/mediapipe/WORKSPACE:404:14: in <toplevel>
  C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/tensorflow/workspace2.bzl:868:19: in workspace
  C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/tensorflow/workspace2.bzl:91:27: in _tf_toolchains
  C:/users/user/_bazel_user/7he4j6fx/external/tf_toolchains/toolchains/remote_config/configs.bzl:6:28: in initialize_rbe_configs
  C:/users/user/_bazel_user/7he4j6fx/external/tf_toolchains/toolchains/remote_config/rbe_config.bzl:158:27: in _tensorflow_local_config
Repository rule local_python_configure defined at:
  C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/py/python_configure.bzl:279:41: in <toplevel>
ERROR: An error occurred during the fetch of repository 'local_execution_config_python':
   Traceback (most recent call last):
        File "C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/py/python_configure.bzl", line 212, column 22, in _create_local_python_repository
                _check_python_bin(repository_ctx, python_bin)
        File "C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/py/python_configure.bzl", line 145, column 25, in _check_python_bin
                auto_config_fail("--define %s='%s' is not executable. Is it the python binary?" % (
        File "C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/remote_config/common.bzl", line 12, column 9, in auto_config_fail
                fail("%sConfiguration Error:%s %s\n" % (red, no_color, msg))
Error in fail: Configuration Error: --define PYTHON_BIN_PATH='C:/Users/user/.conda/envs/pose/python.exe' is not executable. Is it the python binary?
ERROR: E:/git/mediapipe/WORKSPACE:404:14: fetching local_python_configure rule //external:local_execution_config_python: Traceback (most recent call last):
        File "C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/py/python_configure.bzl", line 212, column 22, in _create_local_python_repository
                _check_python_bin(repository_ctx, python_bin)
        File "C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/py/python_configure.bzl", line 145, column 25, in _check_python_bin
                auto_config_fail("--define %s='%s' is not executable. Is it the python binary?" % (
        File "C:/users/user/_bazel_user/7he4j6fx/external/org_tensorflow/third_party/remote_config/common.bzl", line 12, column 9, in auto_config_fail
                fail("%sConfiguration Error:%s %s\n" % (red, no_color, msg))
Error in fail: Configuration Error: --define PYTHON_BIN_PATH='C:/Users/user/.conda/envs/pose/python.exe' is not executable. Is it the python binary?
ERROR: Analysis of target '//mediapipe/examples/desktop/hello_world:hello_world' failed; build aborted: Configuration Error: --define PYTHON_BIN_PATH='C:/Users/user/.conda/envs/pose/python.exe' is not executable. Is it the python binary?
INFO: Elapsed time: 0.559s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (34 packages loaded, 11 targets configured)

ChesterXcw avatar Aug 05 '22 07:08 ChesterXcw

Hi @ChesterXcw, Thank you for sharing the error log. It seems from the log two different errors are encountered to install the MediaPipe. Could you please try these two pointers to fix it:

  • Fix 'local_execution_config_python' error(follow the steps mentioned here).
  • "Missing Python binary path" follow the command mentioned here to find the python binary executable path and replace in PYTHON_BIN_PATH.

Please let us know if this works. Thank you!

kuaashish avatar Aug 05 '22 07:08 kuaashish

I`m so sorry about that! Neither of them works

First point After exited the file , rerun the command , and no difference from before

Second point: The python binary executable path I find is the path that specified before ,also no difference

ChesterXcw avatar Aug 05 '22 08:08 ChesterXcw

Hi @ChesterXcw, Sorry to hear that it did not work. Could you try this thread for your latest query. If it does not work, I will be assigning this to the appropriate team. Thank you!

kuaashish avatar Aug 05 '22 09:08 kuaashish

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

google-ml-butler[bot] avatar Aug 12 '22 09:08 google-ml-butler[bot]

Closing as stale. Please reopen if you'd like to work on this further.

google-ml-butler[bot] avatar Aug 19 '22 09:08 google-ml-butler[bot]

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Aug 19 '22 09:08 google-ml-butler[bot]

I meet the same problem too, wish for the official answer

simzhangbest avatar Sep 26 '22 05:09 simzhangbest

Hi @simzhangbest, Could you please raise a separate new issue with complete details to reproduce the issue from our end. Thank you!

kuaashish avatar Sep 26 '22 08:09 kuaashish