Quick Install

Get PyGraphviz from the Python Package Index at

or install it with:

pip install pygraphviz

and an attempt will be made to find and install an appropriate version that matches your operating system and Python version.

You can install the development version (at with:

pip install git://

Providing path to graphviz

We tried our best to discover graphviz location automatically, but if you would like specify specific location for graphviz you may provide additrional parameters to specify graphviz location

include-path= path to graphviz include files library-path= path to graphviz library files

For example

python install --include-path=/usr/local/Cellar/graphviz/2.38.0/include/graphviz --library-path=/usr/local/Cellar/graphviz/2.38.0/lib

Installing from Source

You can install from source by downloading a source archive file (tar.gz or zip) or by checking out the source files from the Subversion repository.

Source Archive File

  1. Download the source (tar.gz or zip file).
  2. Unpack and change directory to pygraphviz-“version”
  3. Run “python install” to build and install
  4. (optional) Run “python nosetests” to execute the tests


  1. Clone the pygraphviz repository

(see for other options)

  1. Change directory to “pygraphviz”
  2. Run “python install” to build and install
  3. (optional) Run “python nosetests” to execute the tests

If you don’t have permission to install software on your system, you can install into another directory using the –user, –prefix, or –home flags to

For example

python install --prefix=/home/username/python
python install --home=~
python install --user

If you didn’t install in the standard Python site-packages directory you will need to set your PYTHONPATH variable to the alternate location. See for further details.



PyGraphviz is tested and works with Python 2.7, 3.5, 3.6, and 3.7.

There are several other distributions that contain the key packages you need for scientific computing. See the following link for a list:


To use PyGraphviz you need GraphViz version 2.16 or later. Some versions have known bugs that have been fixed; get the latest release available for best results.