Skip to content

tensorflow-text 2.21.0 fails to import: undefined symbol icudt77_dat #1541

Description

@laxmareddyp

Description

tensorflow-text==2.21.0 fails to import with an undefined symbol: icudt77_dat error. This occurs even with a matching tensorflow==2.21.0 install in a clean environment. tensorflow-text==2.20.1 works fine.

Reproduction (Google Colab)

!pip install tensorflow==2.21.0 tensorflow-text==2.21.0
import tensorflow as tf
print(f"TensorFlow: {tf.__version__}")  # Works: 2.21.0

import tensorflow_text as tft  # CRASHES
print(f"TensorFlow Text: {tft.__version__}")

Error

TensorFlow: 2.21.0
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
[/tmp/ipykernel_4024/3772396424.py](https://localhost:8080/#) in <cell line: 0>()
      2 print(f"TensorFlow: {tf.__version__}")  # Works: 2.21.0
      3 
----> 4 import tensorflow_text as tft  # CRASHES
      5 print(f"TensorFlow Text: {tft.__version__}")

[/usr/local/lib/python3.13/dist-packages/tensorflow_text/__init__.py](https://localhost:8080/#) in <module>
     18 
     19 # pylint: disable=wildcard-import
---> 20 from tensorflow_text.core.pybinds import tflite_registrar
     21 from tensorflow_text.python import keras
     22 from tensorflow_text.python import metrics

ImportError: /usr/local/lib/python3.13/dist-packages/tensorflow_text/core/pybinds/libpybinds_library_common.so: undefined symbol: icudt77_dat

Investigation

We verified the following on Colab:

  • System ICU version: 70.1-2 (libicudata.so.70), confirmed via ldconfig -p | grep libicu and dpkg -l | grep libicu
  • tensorflow-text 2.20.1: Works correctly with tensorflow==2.20.0 on the same system

The icudt77_dat symbol expected by libpybinds_library_common.so is from ICU 77, which is not available on standard Linux distributions:

  • Ubuntu 22.04: ICU 70
  • Ubuntu 24.04: ICU 72
  • Debian 12: ICU 72

Impact

  • Any user running pip install tensorflow-text without a version pin gets 2.21.0, which is broken
  • KerasHub CI was broken across all backends. Required an emergency patch release (v0.31.1) with tensorflow-text<2.21.0 pinned (keras-team/keras-hub#2979)
  • Any downstream project depending on tensorflow-text without an upper bound is affected

Workaround

pip install "tensorflow-text>=2.20.1,<2.21.0"

Environment

  • Python: 3.13 (Google Colab)
  • OS: Ubuntu 22.04
  • tensorflow: 2.21.0
  • tensorflow-text: 2.21.0
  • System ICU: 70.1-2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions