What happened?
pkg_resources (previously deprecated) has been removed in setuptools 82.0 (see setuptools changelog)
So you should replace pkg_resources.parse_version by packaging.version.parse
Relevant code
pip install tensorflow-hub #it will now install setuptools >= 82.0 as a dependency
python
import tensorflow_hub
Relevant log output
==> You will have this error message :
"File "[...]/tensorflow_hub/__init__.py", line 61, in _ensure_tf_install
from pkg_resources import parse_version
ModuleNotFoundError: No module named 'pkg_resources'"
tensorflow_hub Version
0.16.1
TensorFlow Version
2.20.0
Other libraries
I'm using tensorflow_hub 0.16.1 with tensorflow 2.20.0 on Python 3.13 (but it should be the same with any tensorflow release or any Python version)
To keep compatibility with setuptools >= 82 you should replace (__init__.py, line 61) :
from pkg_resources import parse_version
by
from packaging.version import parse as parse_version
Python Version
3.x
OS
Linux
What happened?
pkg_resources(previously deprecated) has been removed insetuptools 82.0(see setuptools changelog)So you should replace
pkg_resources.parse_versionbypackaging.version.parseRelevant code
Relevant log output
==> You will have this error message :
tensorflow_hub Version
0.16.1
TensorFlow Version
2.20.0
Other libraries
I'm using
tensorflow_hub 0.16.1withtensorflow 2.20.0onPython 3.13(but it should be the same with any tensorflow release or any Python version)To keep compatibility with
setuptools >= 82you should replace (__init__.py, line 61) :from pkg_resources import parse_versionby
from packaging.version import parse as parse_versionPython Version
3.x
OS
Linux