tensorflow/text

Cannot not install tensorflow-text from source on darwin/arm64, because `Could not find requirement tensorflow-macos`

zyxkad opened this issue · 3 comments

Descriptions

I already build and installed tensorflow through pip, and I can build tensorflow-text, but when I try to install it, it gave me error:

$ pip3 install tensorflow_text-2.12.0-cp311-cp311-macosx_11_0_arm64.whl 
Processing ./tensorflow_text-2.12.0-cp311-cp311-macosx_11_0_arm64.whl
Requirement already satisfied: tensorflow-hub>=0.8.0 in /opt/homebrew/lib/python3.11/site-packages (from tensorflow-text==2.12.0) (0.13.0)
ERROR: Could not find a version that satisfies the requirement tensorflow-macos<2.13,>=2.12.0; platform_machine == "arm64" and platform_system == "Darwin" (from tensorflow-text) (from versions: none)
ERROR: No matching distribution found for tensorflow-macos<2.13,>=2.12.0; platform_machine == "arm64" and platform_system == "Darwin"

Idk why it require tensorflow-macos, since I already have tensorflow, and I have no idea how to install tensorflow-macos because it seems like doesn't have a arm64 version.

Environments

Commit: e3e9fcf

$ python3 -V && echo '========' && pip3 -V
Python 3.11.2
========
pip 23.0.1 from /opt/homebrew/lib/python3.11/site-packages/pip (python 3.11)
$ bazel --version
bazel 5.3.0
$ clang --version
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

pip requirements

$ pip3 show tensorflow
Name: tensorflow
Version: 2.13.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: /opt/homebrew/lib/python3.11/site-packages
Requires: absl-py, astunparse, flatbuffers, gast, google-pasta, grpcio, h5py, jax, keras, libclang, numpy, opt-einsum, packaging, protobuf, setuptools, six, tensorboard, tensorflow-estimator, termcolor, typing-extensions, wrapt
Required-by: 
$ pip3 show tensorflow-hub
Name: tensorflow-hub
Version: 0.13.0
Summary: TensorFlow Hub is a library to foster the publication, discovery, and consumption of reusable parts of machine learning models.
Home-page: https://github.com/tensorflow/hub
Author: Google LLC
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: /opt/homebrew/lib/python3.11/site-packages
Requires: numpy, protobuf
Required-by: 

Currently tensorflow-macos only provides versions 3.8-3.10, and does not support 3.11. tensorflow-text needs to match the tensorflow version, your current installation is tensorflow 2.13.
The correct way is to install any python version of tensorflow/tensorflow-macos 2.12 from 3.8-3.10, and then install tensorflow-text 2.12.

I am having the same issue.

I have tensorflow-macos=2.12
Screenshot 2023-05-24 at 12 50 29 PM

On trying to install tensorflow-text, getting following error.

Screenshot 2023-05-24 at 12 50 47 PM

Env:

Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin


pip3 --version
pip 23.0.1 from /Users/arjun/miniconda3/lib/python3.10/site-packages/pip (python 3.10)


Python3 -V
Python 3.10.10

tensorflow-text does not provide a pre-compiled whl file officially, you need to build it manually. You can build from this tutorial or download the whl file I've built.