How to get started with graphviz?

1,487 views
Skip to first unread message

DavidA

unread,
Sep 18, 2015, 10:23:50 AM9/18/15
to sphinx-users
Hi, 

I am fairly new to Sphinx. I have autogenerated docs from my Python docstrings and now want to add a diagram using graphviz. 

This is what I've done so far:


I'm working on Windows. Do I need to install graphviz using pip?

Best regards

David

Andrew Ball

unread,
Sep 19, 2015, 12:19:55 AM9/19/15
to sphinx...@googlegroups.com

Nope. You would just install Graphviz following the instructions on its website. There appears to be a Windows installer.

--
You received this message because you are subscribed to the Google Groups "sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users...@googlegroups.com.
To post to this group, send email to sphinx...@googlegroups.com.
Visit this group at http://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

DavidA

unread,
Sep 21, 2015, 4:33:52 AM9/21/15
to sphinx-users
Thanks for your answer. I installed graphviz on Windows and added this to my path:

"C:\Program Files (x86)\Graphviz2.38\bin"

In conf.py I have:

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.todo',
    'sphinx.ext.viewcode',
    'sphinx.ext.napoleon',
    'sphinx.ext.graphviz'
]

but when I generate my html I get:

pickling environment... done
checking consistency... done
preparing documents... done
WARNING: dot command 'dot' cannot be run (needed for graphviz output), check the graphviz_dot setting

and no graphviz diagram appears.

How can I fix that warning please?

Best regards

David

Andrew Ball

unread,
Sep 21, 2015, 10:26:03 AM9/21/15
to sphinx...@googlegroups.com
What happens when you try to run "dot -v" on the same command line where you run Sphinx?
--
=======================
Andrew D. Ball
勃安德魯

DavidA

unread,
Sep 21, 2015, 5:24:13 PM9/21/15
to sphinx-users
C:\PythonDocs>dot -v
dot - graphviz version 2.38.0 (20140413.2041)
libdir = "C:\Program Files (x86)\Graphviz2.38\bin"
Activated plugin library: gvplugin_dot_layout.dll
Using layout: dot:dot_layout
Activated plugin library: gvplugin_core.dll
Using render: dot:core
Using device: dot:dot:core
The plugin configuration file:
        C:\Program Files (x86)\Graphviz2.38\bin\config6
                was successfully loaded.
    render      :  cairo dot fig gd gdiplus map pic pov ps svg tk vml vrml xdot
    layout      :  circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
    textlayout  :  textlayout
    device      :  bmp canon cmap cmapx cmapx_np dot emf emfplus eps fig gd gd2 gif gv imap imap_np ismap jpe jpeg jpg m
etafile pdf pic plain plain-ext png pov ps ps2 svg svgz tif tiff tk vml vmlz vrml wbmp xdot xdot1.2 xdot1.4
    loadimage   :  (lib) bmp eps gd gd2 gif jpe jpeg jpg png ps svg

DavidA

unread,
Sep 21, 2015, 5:24:13 PM9/21/15
to sphinx-users
I see:

DavidA

unread,
Sep 22, 2015, 11:37:17 AM9/22/15
to sphinx-users
Still struggling with this.  I have tried:

C:\>make html SPHINXOPTS="-D graphviz_dot=C:\Program Files (x86)\Graphviz2.38\bin\dot.exe"

Is that the correct approach? Anything wrong with it?

DavidA

unread,
Sep 25, 2015, 6:03:37 AM9/25/15
to sphinx-users
Fixed. On Windows, this works for me:

sphinx-build -b html -D graphviz_dot="C:\Program Files (x86)\Graphviz2.38\bin\dot.exe" source build/html

 

or :

 

SET SPHINXOPTS=-D graphviz_dot="C:\Program Files (x86)\Graphviz2.38\bin\dot.exe"

make html

 

Reply all
Reply to author
Forward
0 new messages