0

I want to show my python code in sphinx, however when I run "make html" it shows some errors. The main file name is Compliance_modular.py and the error is the next one:

WARNING: autodoc: failed to import module 'Compliance_modular'; the following exception was 
raised:
No module named 'airflow'

It is because I am using a file which depend on other files at the beginning I don't know how to include or omit those missing modules.

from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import PythonOperator
from airflow.operators.email_operator import EmailOperator
mzjn
  • 48,958
  • 13
  • 128
  • 248
M_A
  • 11
  • 4
  • 1
    It's a warning. If your documentation renders, you can ignore it or suppress it. If you want to resolve it, then the airflow package must be importable, which means it must be installed in your virtual environment. – Steve Piercy Nov 24 '20 at 06:51
  • 1
    Perhaps you just need to mock `airflow`. See https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_mock_imports – mzjn Nov 24 '20 at 14:07

0 Answers0