[Python] Error 'Failed to import plugin opt/airflow/plugins/operatos/. . . ' when running...

Discussão em 'Python' iniciado por Stack, Abril 15, 2025.

  1. Stack

    Stack Membro Participativo

    In my project, I build a docker image on my local machine, then pull the image to the production machine. On my local machine, I can still run the image using the docker-compose up command to create a container.

    But on the production machine, I get an error message in logs:

    {plugins_manager.py:305} ERROR - Failed to import plugin /opt/airflow/plugins/operators/name.py
    airflow-init | Traceback (most recent call last):
    airflow-init | File "/home/airflow/.local/lib/python3.10/site-packages/airflow/plugins_manager.py", line 298, in load_plugins_from_plugin_directory
    airflow-init | loader.exec_module(mod)
    airflow-init | File "<frozen importlib._bootstrap_external>", line 883, in exec_module
    airflow-init | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
    airflow-init | File "/opt/airflow/plugins/operators/name.py", line 33, in <module>
    airflow-init | from helper1.task_logger import TaskRunMetadata
    airflow-init | ModuleNotFoundError: No module named 'helper1'


    On both machines I have the same docker library configuration, I also copied all the configuration files to the product machine just in case. The plugin files in that path still exist. I don't know why it says Failed to import plugin

    Thanks for your help.

    Continue reading...

Compartilhe esta Página