Best guess: you probably have everything you need installed. Maybe there really is (just) a syntax error. If so, is it a Python syntax error or a Graphviz syntax error?
On this page (graphviz · PyPI) note the part that says
check the generated source code
I’d do that and then run that “manually” thru dot