Fix:
Force the environment to use Python 3.9, which is the latest compatible version.
dockerfile
FROM python:3.9.22-slim # Explicitly use Python 3.9
RUN pip install absl-py==0.9.0
bash
python3.9 -m pip install absl-py==0.9.0
Why Python 3.9?
absl-py==0.9.0
was tested on Python 3.4–3.9.
Python 3.10+ introduces breaking changes that block installation.
No Workarounds Needed → Just use Python 3.9 and it will work.