Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration Error: --define PYTHON_BIN_PATH='C:/Users/user/AppData/Local/Programs/Python/Python39/python.exe' is not executable. Is it the python binary? #56420

Closed
guweixin opened this issue Jun 10, 2022 · 11 comments
Assignees
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author subtype:windows Windows Build/Installation Issues TF 2.9 Issues found in the TF 2.9 release (or RCs) type:build/install Build and install issues

Comments

@guweixin
Copy link

guweixin commented Jun 10, 2022

Click to expand!

Issue Type

Bug

Source

source

Tensorflow Version

tf2.9.1

Custom Code

No

OS Platform and Distribution

win10

Mobile device

No response

Python version

3.9

Bazel version

5.1.1

GCC/Compiler version

No response

CUDA/cuDNN version

No response

GPU model and memory

No response

Current Behaviour?

A bug happened!
bazel build -c opt --config=monolithic --define=with_select_tf_ops=true tensorflow/lite/delegates/flex:tensorflowlite_flex
WARNING: The following configs were expanded more than once: [monolithic]. For repeatable flags, repeats are counted twice and may lead to unexpected behavior.
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=190
INFO: Reading rc options for 'build' from d:\ai_framework\tensorflow_src\.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Options provided by the client:
  'build' options: --python_path=C:/Users/user/AppData/Local/Programs/Python/Python39/python.exe
INFO: Reading rc options for 'build' from d:\ai_framework\tensorflow_src\.bazelrc:
  'build' options: --define framework_shared_object=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library
INFO: Reading rc options for 'build' from d:\ai_framework\tensorflow_src\.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=C:/Users/user/AppData/Local/Programs/Python/Python39/python.exe --action_env PYTHON_LIB_PATH=C:/Users/user/AppData/Local/Programs/Python/Python39/lib/site-packages --python_path=C:/Users/user/AppData/Local/Programs/Python/Python39/python.exe --copt=/d2ReducedOptimizeHugeFunctions --host_copt=/d2ReducedOptimizeHugeFunctions --define=override_eigen_strong_inline=true
INFO: Reading rc options for 'build' from d:\ai_framework\tensorflow_src\.bazelrc:
  'build' options: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/common,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils
INFO: Found applicable config definition build:short_logs in file d:\ai_framework\tensorflow_src\.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file d:\ai_framework\tensorflow_src\.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:monolithic in file d:\ai_framework\tensorflow_src\.bazelrc: --define framework_shared_object=false
INFO: Found applicable config definition build:windows in file d:\ai_framework\tensorflow_src\.bazelrc: --copt=/W0 --copt=/D_USE_MATH_DEFINES --host_copt=/D_USE_MATH_DEFINES --cxxopt=/std:c++14 --host_cxxopt=/std:c++14 --config=monolithic --copt=-DWIN32_LEAN_AND_MEAN --host_copt=-DWIN32_LEAN_AND_MEAN --copt=-DNOGDI --host_copt=-DNOGDI --copt=/experimental:preprocessor --host_copt=/experimental:preprocessor --linkopt=/DEBUG --host_linkopt=/DEBUG --linkopt=/OPT:REF --host_linkopt=/OPT:REF --linkopt=/OPT:ICF --host_linkopt=/OPT:ICF --verbose_failures --features=compiler_param_file --distinct_host_configuration=false
INFO: Found applicable config definition build:monolithic in file d:\ai_framework\tensorflow_src\.bazelrc: --define framework_shared_object=false
INFO: Repository local_execution_config_python instantiated at:
  D:/ai_framework/tensorflow_src/WORKSPACE:15:14: in <toplevel>
  D:/ai_framework/tensorflow_src/tensorflow/workspace2.bzl:870:19: in workspace
  D:/ai_framework/tensorflow_src/tensorflow/workspace2.bzl:91:27: in _tf_toolchains
  D:/ai_framework/tensorflow_src/tensorflow/tools/toolchains/remote_config/configs.bzl:6:28: in initialize_rbe_configs
  D:/ai_framework/tensorflow_src/tensorflow/tools/toolchains/remote_config/rbe_config.bzl:158:27: in _tensorflow_local_config
Repository rule local_python_configure defined at:
  D:/ai_framework/tensorflow_src/third_party/py/python_configure.bzl:280:41: in <toplevel>
ERROR: An error occurred during the fetch of repository 'local_execution_config_python':
   Traceback (most recent call last):
        File "D:/ai_framework/tensorflow_src/third_party/py/python_configure.bzl", line 213, column 22, in _create_local_python_repository
                _check_python_bin(repository_ctx, python_bin)
        File "D:/ai_framework/tensorflow_src/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? %s" % (
        File "D:/ai_framework/tensorflow_src/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/AppData/Local/Programs/Python/Python39/python.exe' is not executable. Is it the python binary? <unknown object com.google.devtools.build.lib.bazel.repository.starlark.StarlarkRepositoryContext>
ERROR: D:/ai_framework/tensorflow_src/WORKSPACE:15:14: fetching local_python_configure rule //external:local_execution_config_python: Traceback (most recent call last):
        File "D:/ai_framework/tensorflow_src/third_party/py/python_configure.bzl", line 213, column 22, in _create_local_python_repository
                _check_python_bin(repository_ctx, python_bin)
        File "D:/ai_framework/tensorflow_src/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? %s" % (
        File "D:/ai_framework/tensorflow_src/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/AppData/Local/Programs/Python/Python39/python.exe' is not executable. Is it the python binary? <unknown object com.google.devtools.build.lib.bazel.repository.starlark.StarlarkRepositoryContext>
ERROR: Analysis of target '//tensorflow/lite/delegates/flex:tensorflowlite_flex' failed; build aborted: Configuration Error: --define PYTHON_BIN_PATH='C:/Users/user/AppData/Local/Programs/Python/Python39/python.exe' is not executable. Is it the python binary? <unknown object com.google.devtools.build.lib.bazel.repository.starlark.StarlarkRepositoryContext>
INFO: Elapsed time: 0.226s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
    Fetching @local_config_python; fetching

Standalone code to reproduce the issue

python configure.py
bazel build -c opt --config=monolithic --define=with_select_tf_ops=true tensorflow/lite/delegates/flex:tensorflowlite_flex

Relevant log output

No response

@guweixin
Copy link
Author

guweixin commented Jun 10, 2022

I met this issue on cmd, but did not meet it on git bash.
I don`t know why

@mohantym mohantym added type:build/install Build and install issues TF 2.9 Issues found in the TF 2.9 release (or RCs) subtype:windows Windows Build/Installation Issues and removed type:bug Bug labels Jun 10, 2022
@mohantym
Copy link
Contributor

mohantym commented Jun 10, 2022

Hi @guweixin ! Thanks for reporting this bug . @gadagashwini ! Could you please look at this issue . It is replicating in 2.8, 2.9 and master branch with both Python 3.8 and 3.9 (Tested in local machines) . Found a similar issue here . Thank you!

@mohantym mohantym added stat:awaiting response Status - Awaiting response from author and removed stat:awaiting response Status - Awaiting response from author labels Jun 10, 2022
@mohantym mohantym assigned gadagashwini and unassigned mohantym Jun 10, 2022
@gadagashwini
Copy link
Contributor

HI @guweixin,

Please do the following steps to fix it manually.

Step 1. Open the python_configure.bzl file, in my example the file path from here

cmd += "system(\"%s script.py\");" % python_bin.replace("\\","/")

Step 2. Rerun the build command. Then, you can go further and see another error "invalid escape sequence".

ERROR
C:/users/username/_bazel_username/external/local_execution_config_python/BUILD:11:24: invalid escape sequence: \U
ERROR: C:/users/username/_bazel_username/external/local_execution_config_python/BUILD:17:24: invalid escape sequence: \U

Step 3. Open the BUILD file, in my example the file path is C:/external/local_execution_config_python/BUILD, and replace every \ with \ at line 11 and 17.

Step 4. Continue the build process.

Refer similar issue here. Thank you!

@gadagashwini gadagashwini added the stat:awaiting response Status - Awaiting response from author label Jun 13, 2022
@google-ml-butler
Copy link

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

@google-ml-butler google-ml-butler bot added the stale This label marks the issue/pr stale - to be closed automatically if no activity label Jun 20, 2022
@google-ml-butler
Copy link

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

@google-ml-butler
Copy link

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

@guweixin
Copy link
Author

guweixin commented Oct 9, 2022

@gadagashwini Sorry, I follow step1 and step2, but it doesn't work, I meet the same error again.

@sssstudyy
Copy link

@guweixin pardon,have you solved this question? I have met the same error today, Any help would be appreciated!

@guweixin
Copy link
Author

@sssstudyy still not solved.

@hustc12
Copy link

hustc12 commented May 16, 2023

I have this issue on Windows as well.

@nigue3025
Copy link

I met this issue on cmd, but did not meet it on git bash. I don`t know why

I met this issue too. (win10 professional 22H2)

As switching git bash from cmd to build, it can be compiled successfully.

(But what I need and the syntax I runned is not the same as yours=> bazel build --config=opt tensorflow:tensorflow.dll)

Thanks for sharing anyway, it helps!

(Btw. I also tried to build it by the default Bash of MobaXterm and the error did not occur neither. )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This label marks the issue/pr stale - to be closed automatically if no activity stat:awaiting response Status - Awaiting response from author subtype:windows Windows Build/Installation Issues TF 2.9 Issues found in the TF 2.9 release (or RCs) type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

6 participants