Skip to content

ImportError: cannot import name 'version' from 'tfx' when using tfx==1.16.0 #7773

@aidandunlop

Description

@aidandunlop

System information

  • Have I specified the code to reproduce the issue: Yes
  • Environment in which the code is executed: Locally (Linux and MacOS)
  • TensorFlow version: n/a
  • TFX Version: 1.16.0
  • Python version: 3.10.12
  • Python dependencies (from pip freeze output):
absl-py==1.4.0
attrs==25.1.0
cachetools==5.5.2
certifi==2025.1.31
charset-normalizer==3.4.1
click==7.1.2
cloudpickle==2.2.1
Deprecated==1.2.18
docstring_parser==0.16
dunamai==1.20.0
fire==0.7.0
google-api-core==2.24.1
google-api-python-client==1.12.11
google-auth==2.38.0
google-auth-httplib2==0.2.0
google-cloud-core==2.4.2
google-cloud-storage==2.19.0
google-crc32c==1.6.0
google-resumable-media==2.7.2
googleapis-common-protos==1.68.0
httplib2==0.22.0
idna==3.10
Jinja2==3.1.3
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
kfp==1.8.22
kfp-pipeline-spec==0.1.16
kfp-server-api==1.8.5
kubernetes==25.3.0
MarkupSafe==2.1.5
oauthlib==3.2.2
packaging==24.0
poetry-dynamic-versioning==1.2.0
proto-plus==1.26.0
protobuf==3.20.3
pyasn1==0.6.1
pyasn1_modules==0.4.1
pydantic==1.10.21
pyparsing==3.2.1
python-dateutil==2.9.0.post0
PyYAML==6.0.2
referencing==0.36.2
requests==2.32.3
requests-oauthlib==2.0.0
requests-toolbelt==0.10.1
rpds-py==0.23.1
rsa==4.9
six==1.17.0
strip-hints==0.1.13
tabulate==0.9.0
termcolor==2.5.0
tomlkit==0.12.4
typer==0.10.0
typing_extensions==4.12.2
uritemplate==3.0.1
urllib3==1.26.20
uv==0.6.2
websocket-client==1.8.0
wrapt==1.17.2

Describe the current behavior
When importing kubeflow_v2_dag_runner, the import fails with the error:

ImportError: cannot import name 'version' from 'tfx' (unknown location)

Describe the expected behavior
When importing kubeflow_v2_dag_runner, the import should succeed. This works fine when using tfx==1.15.1

Standalone code to reproduce the issue

# When using tfx==1.16.0
from tfx.orchestration.kubeflow.v2 import kubeflow_v2_dag_runner
print(dir(kubeflow_v2_dag_runner))

Other info / logs
It seems to be failing to find this file: https://github.com/tensorflow/tfx/blob/r1.16.0/tfx/version.py. It seems it has somehow been missed from the release version installed via pypi?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions