tensorflow / tflite-micro

Infrastructure to enable deployment of ML models to low-power resource-constrained embedded targets (including microcontrollers and digital signal processors).
Apache License 2.0
1.83k stars 803 forks source link

bazel error: Can't find python in path. #2381

Closed Lieber0402 closed 7 months ago

Lieber0402 commented 8 months ago

When using the command "bazel build", it came out the error with this tip "Python Configuration Error: Cannot find python in PATH, please make sure python is installed and add its directory in PATH, or --define PYTHON_BIN_PATH='/something/else'."

But I believe that I have already put the python into the PATH. But it still doesn't work. And I'm now wondering why.

Detailed error tips:

D:\Desktop\tflite-micro>bazel build tensorflow/lite/micro/examples/hello_world:evaluate Starting local Bazel server and connecting to it... INFO: Repository local_config_python instantiated at: D:/desktop/tflite-micro/WORKSPACE:74:17: in Repository rule python_configure defined at: C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl:412:35: in ERROR: An error occurred during the fetch of repository 'local_config_python': Traceback (most recent call last): File "C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl", line 409, column 36, in _python_autoconf_impl _create_local_python_repository(repository_ctx) File "C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl", line 355, column 33, in _create_local_python_repository python_bin = _get_python_bin(repository_ctx) File "C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl", line 173, column 10, in _get_python_bin _fail("Cannot find python in PATH, please make sure " + File "C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl", line 27, column 9, in _fail fail("%sPython Configuration Error:%s %s\n" % (red, no_color, msg)) Error in fail: Python Configuration Error: Cannot find python in PATH, please make sure python is installed and add its directory in PATH, or --define PYTHON_BIN_PATH='/something/else'. PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;E:\Cmake\bin;E:\Kendryte\Kendryte-toolchain\bin;E:\Mingw64\mingw64\mingw64\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Common Files\Propellerhead Software\ReWire\;C:\Program Files\Common Files\Propellerhead Software\ReWire\;E:\Git\cmd;E:\msys64\usr\bin;E:\msys64\usr\bin\bash.exe;E:\bazel\;C:\Users\Lieber\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\python 3.9;E:\anaconda3;E:\anaconda3\Scripts;E:\anaconda3\Library\bin;E:\anaconda3\Library\mingw64-w64\bin;C:\Users\Lieber\AppData\Local\Microsoft\WindowsApps;;E:\PyCharm Community Edition 2022.1.4\bin;;C:\Users\Lieber.dotnet\tools;C:\Users\Lieber\AppData\Local\Programs\Microsoft VS Code\bin ERROR: D:/desktop/tflite-micro/WORKSPACE:74:17: fetching python_configure rule //external:local_config_python: Traceback (most recent call last): File "C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl", line 409, column 36, in _python_autoconf_impl _create_local_python_repository(repository_ctx) File "C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl", line 355, column 33, in _create_local_python_repository python_bin = _get_python_bin(repository_ctx) File "C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl", line 173, column 10, in _get_python_bin _fail("Cannot find python in PATH, please make sure " + File "C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl", line 27, column 9, in _fail fail("%sPython Configuration Error:%s %s\n" % (red, no_color, msg)) Error in fail: Python Configuration Error: Cannot find python in PATH, please make sure python is installed and add its directory in PATH, or --define PYTHON_BIN_PATH='/something/else'. PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;E:\Cmake\bin;E:\Kendryte\Kendryte-toolchain\bin;E:\Mingw64\mingw64\mingw64\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Common Files\Propellerhead Software\ReWire\;C:\Program Files\Common Files\Propellerhead Software\ReWire\;E:\Git\cmd;E:\msys64\usr\bin;E:\msys64\usr\bin\bash.exe;E:\bazel\;C:\Users\Lieber\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\python 3.9;E:\anaconda3;E:\anaconda3\Scripts;E:\anaconda3\Library\bin;E:\anaconda3\Library\mingw64-w64\bin;C:\Users\Lieber\AppData\Local\Microsoft\WindowsApps;;E:\PyCharm Community Edition 2022.1.4\bin;;C:\Users\Lieber.dotnet\tools;C:\Users\Lieber\AppData\Local\Programs\Microsoft VS Code\bin INFO: Repository pypi__pip_tools instantiated at: D:/desktop/tflite-micro/WORKSPACE:47:10: in C:/users/lieber/_bazel_lieber/64maqpr4/external/rules_python/python/pip.bzl:149:29: in pip_parse C:/users/lieber/_bazel_lieber/64maqpr4/external/rules_python/python/pip_install/repositories.bzl:141:14: in pip_install_dependencies C:/users/lieber/_bazel_lieber/64maqpr4/external/bazel_tools/tools/build_defs/repo/utils.bzl:240:18: in maybe Repository rule http_archive defined at: C:/users/lieber/_bazel_lieber/64maqpr4/external/bazel_tools/tools/build_defs/repo/http.bzl:384:31: in ERROR: no such package '@@local_config_python//': Python Configuration Error: Cannot find python in PATH, please make sure python is installed and add its directory in PATH, or --define PYTHON_BIN_PATH='/something/else'. PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;E:\Cmake\bin;E:\Kendryte\Kendryte-toolchain\bin;E:\Mingw64\mingw64\mingw64\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Common Files\Propellerhead Software\ReWire\;C:\Program Files\Common Files\Propellerhead Software\ReWire\;E:\Git\cmd;E:\msys64\usr\bin;E:\msys64\usr\bin\bash.exe;E:\bazel\;C:\Users\Lieber\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\python 3.9;E:\anaconda3;E:\anaconda3\Scripts;E:\anaconda3\Library\bin;E:\anaconda3\Library\mingw64-w64\bin;C:\Users\Lieber\AppData\Local\Microsoft\WindowsApps;;E:\PyCharm Community Edition 2022.1.4\bin;;C:\Users\Lieber.dotnet\tools;C:\Users\Lieber\AppData\Local\Programs\Microsoft VS Code\bin ERROR: D:/desktop/tflite-micro/python/tflite_micro/BUILD:48:17: //python/tflite_micro:_runtime.so depends on @@local_config_python//:python_headers in repository @@local_config_python which failed to fetch. no such package '@@local_config_python//': Python Configuration Error: Cannot find python in PATH, please make sure python is installed and add its directory in PATH, or --define PYTHON_BIN_PATH='/something/else'. PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;E:\Cmake\bin;E:\Kendryte\Kendryte-toolchain\bin;E:\Mingw64\mingw64\mingw64\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Common Files\Propellerhead Software\ReWire\;C:\Program Files\Common Files\Propellerhead Software\ReWire\;E:\Git\cmd;E:\msys64\usr\bin;E:\msys64\usr\bin\bash.exe;E:\bazel\;C:\Users\Lieber\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\python 3.9;E:\anaconda3;E:\anaconda3\Scripts;E:\anaconda3\Library\bin;E:\anaconda3\Library\mingw64-w64\bin;C:\Users\Lieber\AppData\Local\Microsoft\WindowsApps;;E:\PyCharm Community Edition 2022.1.4\bin;;C:\Users\Lieber.dotnet\tools;C:\Users\Lieber\AppData\Local\Programs\Microsoft VS Code\bin ERROR: Analysis of target '//tensorflow/lite/micro/examples/hello_world:evaluate' failed; build aborted: Analysis failed INFO: Elapsed time: 5.266s, Critical Path: 0.90s INFO: 1 process: 1 internal. ERROR: Build did NOT complete successfully FAILED: Fetching repository @@tflm_pip_deps_tensorflow_cpu; Restarting. Fetching repository @@tflm_pip_deps_numpy; Restarting. Fetching repository @@flatbuffers; starting Fetching C:/users/lieber/_bazel_lieber/64maqpr4/external/flatbuffers; Extracting v23.5.26.tar.gz Fetching repository @@numpy_cc_deps; Restarting. Fetching https://files.pythonhosted.org/.../pip_tools-6.12.1-py3-none-any.whl

D:\Desktop\tflite-micro>bazel build tensorflow/lite/micro/examples/hello_world:evaluate INFO: Repository local_config_python instantiated at: D:/desktop/tflite-micro/WORKSPACE:74:17: in Repository rule python_configure defined at: C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl:412:35: in ERROR: An error occurred during the fetch of repository 'local_config_python': Traceback (most recent call last): File "C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl", line 409, column 36, in _python_autoconf_impl _create_local_python_repository(repository_ctx) File "C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl", line 355, column 33, in _create_local_python_repository python_bin = _get_python_bin(repository_ctx) File "C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl", line 173, column 10, in _get_python_bin _fail("Cannot find python in PATH, please make sure " + File "C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl", line 27, column 9, in _fail fail("%sPython Configuration Error:%s %s\n" % (red, no_color, msg)) Error in fail: Python Configuration Error: Cannot find python in PATH, please make sure python is installed and add its directory in PATH, or --define PYTHON_BIN_PATH='/something/else'. PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;E:\Cmake\bin;E:\Kendryte\Kendryte-toolchain\bin;E:\Mingw64\mingw64\mingw64\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Common Files\Propellerhead Software\ReWire\;C:\Program Files\Common Files\Propellerhead Software\ReWire\;E:\Git\cmd;E:\msys64\usr\bin;E:\msys64\usr\bin\bash.exe;E:\bazel\;C:\Users\Lieber\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\python 3.9;E:\anaconda3;E:\anaconda3\Scripts;E:\anaconda3\Library\bin;E:\anaconda3\Library\mingw64-w64\bin;C:\Users\Lieber\AppData\Local\Microsoft\WindowsApps;;E:\PyCharm Community Edition 2022.1.4\bin;;C:\Users\Lieber.dotnet\tools;C:\Users\Lieber\AppData\Local\Programs\Microsoft VS Code\bin ERROR: D:/desktop/tflite-micro/WORKSPACE:74:17: fetching python_configure rule //external:local_config_python: Traceback (most recent call last): File "C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl", line 409, column 36, in _python_autoconf_impl _create_local_python_repository(repository_ctx) File "C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl", line 355, column 33, in _create_local_python_repository python_bin = _get_python_bin(repository_ctx) File "C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl", line 173, column 10, in _get_python_bin _fail("Cannot find python in PATH, please make sure " + File "C:/users/lieber/_bazel_lieber/64maqpr4/external/pybind11_bazel/python_configure.bzl", line 27, column 9, in _fail fail("%sPython Configuration Error:%s %s\n" % (red, no_color, msg)) Error in fail: Python Configuration Error: Cannot find python in PATH, please make sure python is installed and add its directory in PATH, or --define PYTHON_BIN_PATH='/something/else'. PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;E:\Cmake\bin;E:\Kendryte\Kendryte-toolchain\bin;E:\Mingw64\mingw64\mingw64\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Common Files\Propellerhead Software\ReWire\;C:\Program Files\Common Files\Propellerhead Software\ReWire\;E:\Git\cmd;E:\msys64\usr\bin;E:\msys64\usr\bin\bash.exe;E:\bazel\;C:\Users\Lieber\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\python 3.9;E:\anaconda3;E:\anaconda3\Scripts;E:\anaconda3\Library\bin;E:\anaconda3\Library\mingw64-w64\bin;C:\Users\Lieber\AppData\Local\Microsoft\WindowsApps;;E:\PyCharm Community Edition 2022.1.4\bin;;C:\Users\Lieber.dotnet\tools;C:\Users\Lieber\AppData\Local\Programs\Microsoft VS Code\bin INFO: Repository pypi__pip_tools instantiated at: D:/desktop/tflite-micro/WORKSPACE:47:10: in C:/users/lieber/_bazel_lieber/64maqpr4/external/rules_python/python/pip.bzl:149:29: in pip_parse C:/users/lieber/_bazel_lieber/64maqpr4/external/rules_python/python/pip_install/repositories.bzl:141:14: in pip_install_dependencies C:/users/lieber/_bazel_lieber/64maqpr4/external/bazel_tools/tools/build_defs/repo/utils.bzl:240:18: in maybe Repository rule http_archive defined at: C:/users/lieber/_bazel_lieber/64maqpr4/external/bazel_tools/tools/build_defs/repo/http.bzl:384:31: in ERROR: no such package '@@local_config_python//': Python Configuration Error: Cannot find python in PATH, please make sure python is installed and add its directory in PATH, or --define PYTHON_BIN_PATH='/something/else'. PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;E:\Cmake\bin;E:\Kendryte\Kendryte-toolchain\bin;E:\Mingw64\mingw64\mingw64\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Common Files\Propellerhead Software\ReWire\;C:\Program Files\Common Files\Propellerhead Software\ReWire\;E:\Git\cmd;E:\msys64\usr\bin;E:\msys64\usr\bin\bash.exe;E:\bazel\;C:\Users\Lieber\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\python 3.9;E:\anaconda3;E:\anaconda3\Scripts;E:\anaconda3\Library\bin;E:\anaconda3\Library\mingw64-w64\bin;C:\Users\Lieber\AppData\Local\Microsoft\WindowsApps;;E:\PyCharm Community Edition 2022.1.4\bin;;C:\Users\Lieber.dotnet\tools;C:\Users\Lieber\AppData\Local\Programs\Microsoft VS Code\bin ERROR: D:/desktop/tflite-micro/python/tflite_micro/BUILD:48:17: //python/tflite_micro:_runtime.so depends on @@local_config_python//:python_headers in repository @@local_config_python which failed to fetch. no such package '@@local_config_python//': Python Configuration Error: Cannot find python in PATH, please make sure python is installed and add its directory in PATH, or --define PYTHON_BIN_PATH='/something/else'. PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;E:\Cmake\bin;E:\Kendryte\Kendryte-toolchain\bin;E:\Mingw64\mingw64\mingw64\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Common Files\Propellerhead Software\ReWire\;C:\Program Files\Common Files\Propellerhead Software\ReWire\;E:\Git\cmd;E:\msys64\usr\bin;E:\msys64\usr\bin\bash.exe;E:\bazel\;C:\Users\Lieber\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\python 3.9;E:\anaconda3;E:\anaconda3\Scripts;E:\anaconda3\Library\bin;E:\anaconda3\Library\mingw64-w64\bin;C:\Users\Lieber\AppData\Local\Microsoft\WindowsApps;;E:\PyCharm Community Edition 2022.1.4\bin;;C:\Users\Lieber.dotnet\tools;C:\Users\Lieber\AppData\Local\Programs\Microsoft VS Code\bin ERROR: Analysis of target '//tensorflow/lite/micro/examples/hello_world:evaluate' failed; build aborted: Analysis failed INFO: Elapsed time: 0.439s, Critical Path: 0.04s INFO: 1 process: 1 internal. ERROR: Build did NOT complete successfully FAILED: Fetching repository @@tflm_pip_deps_numpy; Restarting. Fetching repository @@tflm_pip_deps_tensorflow_cpu; Restarting. Fetching repository @@numpy_cc_deps; Restarting. Fetching repository @@flatbuffers; starting Fetching https://files.pythonhosted.org/.../pip_tools-6.12.1-py3-none-any.whl

github-actions[bot] commented 7 months ago

"This issue is being marked as stale due to inactivity. Remove label or comment to prevent closure in 5 days."

github-actions[bot] commented 7 months ago

"This issue is being closed because it has been marked as stale for 5 days with no further activity."