tensorflow / tensorflow/tflite-support

ios TensorFlowLiteTaskVision build error (env: python: No such file or directory)

Open
#794 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
441
Forks
146
PR merge metrics
No merged PRs in 30d

Description

I am having build issues on MacOs 12.3. The issue is directly related to bazel and changes in MacOS.
build script:

FRAMEWORK_NAME=TensorFlowLiteTaskVision DEST_DIR=iosbuild 
./tensorflow_lite_support/tools/ci_build/builds/build_ios_framework.sh

Error

ERROR: /Users/tj/projects/edgestore/ModelsAPI/inference/tfliteframework/task/tflite-support/tensorflow_lite_support/ios/BUILD:69:21: Bundling Preprocessed_TensorFlowLiteTaskVisionC_framework failed: (Exit 127): bundletool failed: error executing command 
  (cd /private/var/tmp/_bazel_tj/5d20e619fbfca68099aa0f179b25fe42/execroot/org_tensorflow_lite_support && \
  exec env - \
  bazel-out/host/bin/external/build_bazel_rules_apple/tools/bundletool/bundletool bazel-out/applebin_ios-ios_arm64-opt-ST-02f4a105b518/bin/tensorflow_lite_support/ios/Preprocessed_TensorFlowLiteTaskVisionC_framework-intermediates/bundletool_control.json)
Execution platform: @local_execution_config_platform//:platform
env: python: No such file or directory
Target //tensorflow_lite_support/ios:TensorFlowLiteTaskVisionC_framework failed to build
INFO: Elapsed time: 0.179s, Critical Path: 0.01s
INFO: 2 processes: 2 internal.

I already have python2 and python3 and both binary directories are in PATH variable. What I understand from my research the problem is that Apple removed python 2 and there is no /usr/bin/python binary and no way to add it there. This causes this particular error in bazel versions < 5.0.0. (similar error for reference).

Is it possible to fix this issue and if not can someone please point me to prebuilt binaries?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tensorflow_lite_support/tools/ci_build/builds/build_ios_framework.sh and tensorflow_lite_support/ios/BUILD, then inspect the Bazel bundletool invocation that reports env: python: No such file or directory. Check how the build selects Python on macOS 12.3 and whether the reported Bazel version is affected; done means the TensorFlowLiteTaskVision iOS framework builds successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, python
Domain
build-system, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.