4

I'm trying to install pygraphviz under Ubuntu 10.04 in order to use it within my Django projects.

I used synaptic and it was installed without any problem.

I also installed django-extensions with synaptic (django-extensions has a tool that uses pygraphviz and this is the one that I need)

Now when I try to use django-extensions with pygraphviz

$ python manage.py graph_models -a -g -o model.png

I'm getting an

Error: need pygraphviz python module ( apt-get install python-pygraphviz )

How can I fix this ?

1 Answers1

4

Your script seems to be unable to find the pygraphviz module. To fix that, you should make sure that pygraphviz is in your Python's sys.path.

In case you find out the module is not installed, you have two alternative ways of installing it:

  • sudo apt-get install python-pygraphviz (as suggested by the error message),
  • sudo apt-get install graphviz libgraphviz-dev and
    sudo pip install pygraphviz --install-option='--include-path=/usr/include/graphviz' --install-option='--library-path=/usr/lib/graphviz'
    This is the method I strongly recommend, which uses pip, the Python package installer. Specifying the options is required because otherwise the pygraphviz installer seems unable to find the paths.
simlev
  • 3,912
Tadeck
  • 338