Fixed: "Could not import graphviz. Rendering graph to the graphical format will not be possible." in Apache Airflow®
Every airflow dags command I ran in Apache Airflow® 3.4.0 printed a three-line warning: Could not import graphviz. Rendering graph to the graphical format will not be possible. It appeared even for commands that never draw a graph. Here's where it comes from, the one package that ends it, and why Airflow's graphviz extra doesn't help on a Mac.
What I Was Doing
I had installed Airflow 3.4.0 with uv on Python 3.14, using Airflow's constraints file and no extras. With the project's virtual environment active and AIRFLOW_HOME set, I checked whether any Dag file had failed to load:
airflow dags list-import-errors
What I Expected
No data found, because every Dag file loaded.
What I Got
No data found, after a warning about a package called graphviz:
2026-12-04T10:46:13.912254Z [warning ] Could not import graphviz. Rendering graph to the graphical format will not be possible.
You might need to install the graphviz package and necessary system packages.
Run `pip install graphviz` to attempt to install it. [py.warnings] category=UserWarning filename=.../site-packages/airflow/cli/commands/dag_command.py lineno=57
No data found

The full output also starts with two FileType is deprecated warnings, which I left out here; Fixed: FileType is deprecated explains them. Every other airflow dags command printed the graphviz warning too.
What I Checked
What graphviz is. Graphviz is a tool for drawing graphs, and graphviz is the Python package that describes graphs for it. Airflow uses it to draw a Dag's tasks and their dependencies.
Where the warning comes from. It's raised in airflow/utils/dot_renderer.py, the module that draws Dags. When the module is loaded, it tries import graphviz, and if that fails it warns and carries on without it:
if TYPE_CHECKING:
import graphviz
...
else:
try:
import graphviz
except ImportError:
warnings.warn(
"Could not import graphviz. Rendering graph to the graphical format will not be possible. \n"
"You might need to install the graphviz package and necessary system packages.\n"
"Run `pip install graphviz` to attempt to install it.",
UserWarning,
stacklevel=2,
)
graphviz = None
TYPE_CHECKING is true only for tools that check type hints, so when Airflow runs, the else part is the one that runs. stacklevel=2 makes the warning name the line that loaded the module: line 57 of dag_command.py, the file behind every airflow dags command. So every one of those commands loads dot_renderer and prints the warning, whether it draws anything or not.
Which commands need it. Only three use the drawing code: airflow dags show, airflow dags show-dependencies, and airflow dags test with one of its --show-dagrun, --imgcat-dagrun or --save-dagrun options. Without graphviz, airflow dags show stopped with an error and exit code 1:
airflow.sdk.exceptions.AirflowException: Could not import graphviz. Install the graphviz python package to fix this error.
Why the extra doesn't help on a Mac. Airflow has a graphviz extra, but its package metadata only asks for graphviz on systems other than macOS:
Requires-Dist: graphviz>=0.20; (sys_platform != 'darwin') and extra == 'graphviz'
sys_platform is darwin on macOS, so apache-airflow[graphviz] installs no graphviz there.
Upstream. I reported the warning on every command as apache/airflow#77850. The fix, apache/airflow#77852, stops the warning on commands that don't draw. It's merged, and its 3.4 copy, apache/airflow#77962, is too, both under the milestone Airflow 3.4.1. On 2026-12-04, the newest release on PyPI was still 3.4.0.
Why It Happens
Airflow 3.4.0 loads its graph-drawing module for every airflow dags command, and that module warns as soon as the graphviz Python package is missing. A constraints-file install without extras doesn't include it, and on macOS the graphviz extra doesn't either.
The Fix
Install the graphviz Python package into Airflow's virtual environment, with the same constraints file you installed Airflow with:
uv pip install graphviz --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-3.4.0/constraints-3.14.txt"
Resolved 1 package in 635ms
Prepared 1 package in 98ms
Installed 1 package in 2ms
+ graphviz==0.21

uv pip install graphvizinstalls the package into the active virtual environment.--constraintpoints uv at Airflow's tested versions for Airflow 3.4.0 on Python 3.14, so it picksgraphviz==0.21, the version that file lists. For another Python version, use the file for that version, the same one you installed Airflow with.
If you don't need the drawing commands, you can also leave the warning alone: it's harmless for the other commands, and the upstream fix is set for Airflow 3.4.1.
After the Fix
I ran the same command, then asked Airflow to describe a Dag's graph:
airflow dags list-import-errors
airflow dags show make_breakfast
No data found
digraph make_breakfast {
graph [label=make_breakfast labelloc=t rankdir=LR]
boil_water [color="#000000" fillcolor="#ffefeb" label=boil_water shape=rectangle style="filled,rounded"]
brew_tea [color="#000000" fillcolor="#ffefeb" label=brew_tea shape=rectangle style="filled,rounded"]
serve [color="#000000" fillcolor="#ffefeb" label=serve shape=rectangle style="filled,rounded"]
toast_bread [color="#000000" fillcolor="#ffefeb" label=toast_bread shape=rectangle style="filled,rounded"]
boil_water -> brew_tea
boil_water -> toast_bread
brew_tea -> serve
toast_bread -> serve
}

The graphviz warning is gone, and airflow dags show, which failed before, now prints the Dag in DOT, Graphviz's text format for graphs: one line per task, and one -> line per dependency.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
Installing apache-airflow[graphviz] on macOS | No graphviz: the extra only applies when sys_platform != 'darwin' | Install graphviz itself |
| Installing graphviz without the constraints file | You can get a version Airflow 3.4.0 wasn't tested with | Pass the same --constraint URL as for Airflow |
| Installing it outside the virtual environment | Airflow still can't import it, and the warning stays | Activate the project's .venv first |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
Could not import graphviz. Install the graphviz python package to fix this error. from airflow dags show | graphviz isn't installed in Airflow's environment | Install it as in The Fix |
| The warning stays after the install | The package went into another environment | Run the install with Airflow's .venv active |
FAQ
Do I need graphviz at all?
Only for the commands that draw a Dag: airflow dags show, airflow dags show-dependencies and the drawing options of airflow dags test. The UI draws its own graphs and doesn't use it.
Is the warning harmful?
No. Commands that don't draw work normally: airflow dags list-import-errors printed its answer right after it.
Conclusion
Could not import graphviz came from Airflow 3.4.0's graph-drawing module, which every airflow dags command loads, warning whenever the graphviz Python package is missing. uv pip install graphviz with Airflow's constraints file installed graphviz==0.21, ended the warning, and made airflow dags show work. Airflow 3.4.1 will stop the warning on commands that don't draw.
Additional Resources
- apache/airflow#77850 — the report, and the fix linked from it.
- Installation from PyPI — installing with a constraints file.
- Graphviz — the tool and the DOT language.
Related
- How to Install Apache Airflow® with uv and a Constraints File
- How to Use the Graph View in Apache Airflow®
Apache®, Apache Airflow and Airflow® are either registered trademarks or trademarks of The Apache Software Foundation in the United States and/or other countries. No endorsement by The Apache Software Foundation is implied by the use of these marks.
