text: ERROR: Could not find a version that satisfies the requirement tensorflow_text (from versions: none)
I am using macOS version Monterey on my MI Air and for some reasons I can’t install tensorflow text even though I installed tensorflow. When I run pip3 install tensorflow_text
on terminal it says:
ERROR: Could not find a version that satisfies the requirement tensorflow_text (from versions: none)
ERROR: No matching distribution found for tensorflow_text
I have also tried using pip3 install tensorflow-text
but the result is same. Is there any other way I can install this? Please help as I am very new to python. Regards.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 9
- Comments: 49 (23 by maintainers)
So still no prebuilt version for MacOs? Maybe there is straight forward instruction how to do this?
I was able to build and install tensorflow_text (.whl) for my Apple Macbook Air with the M1 processor following the discussion on this issue by making the following two changes as detailed above:-
cc_toolchain_suite( name = “toolchain”, toolchains = { “darwin|compiler”: “:cc-compiler-darwin”, “darwin_arm64|compiler”: “:cc-compiler-darwin”, # <— new “darwin”: “:cc-compiler-darwin”, “darwin_arm64”: “:cc-compiler-darwin”, # <— new “armeabi-v7a|compiler”: “:cc-compiler-armeabi-v7a”, “armeabi-v7a”: “:cc-compiler-armeabi-v7a”, }, )
A couple things to confirm:
ps. FYI; I saw that legacyai shared their built wheel here on the previous PR. I have no idea of the authenticity package, so typical ‘use at your own risk’ disclaimer.
Try adding this line at the bottom of : https://github.com/tensorflow/text/blob/master/third_party/sentencepiece/BUILD
I checked and the patch file differs in the version of text that I was using (which is https://github.com/tensorflow/text/archive/refs/tags/v2.9.0.zip). I then tried again with the 2.9 branch which does include the right version of sp.patch but I got other errors. This lead me to try several branches and actually the build succeeded with version 2.10! Many thanks for your help!
To anyone reading that ended up here from suns tutorial, here’s what I did to make it work:
You are erroring on the
bazel build
command, so you are building the package. It looks like you ran across the error mentioned above about the missing toolchain. You can try the solution above (https://github.com/tensorflow/text/issues/823#issuecomment-1030305965) or remove mentions of using a toolchain in the .bazelrc file or configure.sh file (and rerun it to write out a new .bazelrc). Then runbazel build oss_scripts/pip_package:build_pip_package
again.