I have installed pygraphviz using easy_install But when i launch python i have an error:
>>>import pygraphviz as pgv
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pygraphviz
>>>
Using Ubuntu 12.04 and gnome-terminal.
On Mac OSX, the following did the trick for me:
[As suggested, fixed typo from previously /urs/local/ to /usr/local/]
On Mac OSX El Capitan, Bart Theeten's solution works but there are two things you need to be careful. Initially, make sure that you installed graphviz on your computer. You can use homebrew:
Other thing is to make sure you add the path of packages to PYTHONPATH
On Ubuntu 14.04, there is a problem in auto detecting graphviz library and include files. If you follow the steps below probably you'll be safe.
Assuming that you're on Ubuntu please look at following steps
sudo apt-get install graphviz libgraphviz-dev pkg-config
sudo apt-get install python-pip python-virtualenv
pip install pygraphviz
Under Ubuntu 15.10+ (ie 2015ish Debian), the quick and easy solution is:
Any dependencies are properly pulled by apt.
The quick and easy solution is:
using pip will also work, but make sure you have graphviz, libgraphviz-dev, and pkg-config already installed.