0

I'm trying to execute the TFX-Airflow tutorial (https://www.tensorflow.org/tfx/tutorials/tfx/airflow_workshop). When I try to connect to the server using airflow webserver -p 8008 it gives me the following error

Traceback (most recent call last):
  File "/home/tester/.local/lib/python3.6/site-packages/airflow/models/dagbag.py", line 243, in process_file
    m = imp.load_source(mod_name, filepath)
  File "/usr/lib/python3.6/imp.py", line 172, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 684, in _load
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/tester/airflow/dags/taxi_pipeline_solution.py", line 26, in <module>
    from tfx.components import CsvExampleGen
  File "/home/tester/Airflow/tfx/tfx/components/__init__.py", line 17, in <module>
    from tfx.components.bulk_inferrer.component import BulkInferrer
  File "/home/tester/Airflow/tfx/tfx/components/bulk_inferrer/component.py", line 19, in <module>
    from tfx.components.bulk_inferrer import executor
  File "/home/tester/Airflow/tfx/tfx/components/bulk_inferrer/executor.py", line 26, in <module>
    from tfx.dsl.components.base import base_executor
  File "/home/tester/Airflow/tfx/tfx/dsl/components/base/base_executor.py", line 33, in <module>
    from tfx.proto.orchestration import execution_result_pb2
ImportError: cannot import name 'execution_result_pb2'

My system is running on Ubuntu 20.04 and I have a virtual environment with all the dependencies installed as listed on the linked tutorial. I've used the 8008 port since I was getting an error with the 8080 port (that the connection is in use).

I read that it could be because the module is missing/circular dependent imports but I'm not sure which packages are responsible. I cannot find an execution_result_pb2.py file on my system (assuming it is a file). Does anyone know how to solve this?

user42
  • 871
  • 1
  • 10
  • 28
  • Please follow these steps and report what you find :- 1)pip show tfx 2)go to Location(site-packages) 3)cd tfx 4)cd proto 5)cd orchestration 6)is executable_spec_pb2.py available inside directory? –  Mar 03 '21 at 13:37
  • Hi, I solved it by creating a new virtual environment and cloning the repository again. – user42 Mar 21 '21 at 19:05

0 Answers0