Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get the graph-models to work (from django-command extensions) on Snow Leopard. It requires pygraphviz, which I installed via macports. After successful install I am getting this error:

>>> import pygrahphviz
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pygrahphviz
>>> import pygraphviz
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.6/site-packages/pygraphviz-1.1-py2.6-macosx-10.6-universal.egg/pygraphviz/", line 54, in <module>
    from agraph import AGraph, Node, Edge, Attribute, ItemAttribute
  File "/Library/Python/2.6/site-packages/pygraphviz-1.1-py2.6-macosx-10.6-universal.egg/pygraphviz/", line 19, in <module>
    import graphviz as gv
  File "/Library/Python/2.6/site-packages/pygraphviz-1.1-py2.6-macosx-10.6-universal.egg/pygraphviz/", line 7, in <module>
    import _graphviz
ImportError: dlopen(/Library/Python/2.6/site-packages/pygraphviz-1.1-py2.6-macosx-10.6-universal.egg/pygraphviz/, 2): Symbol not found: _Agdirected
  Referenced from: /Library/Python/2.6/site-packages/pygraphviz-1.1-py2.6-macosx-10.6-universal.egg/pygraphviz/
  Expected in: flat namespace
 in /Library/Python/2.6/site-packages/pygraphviz-1.1-py2.6-macosx-10.6-universal.egg/pygraphviz/

Any suggestions?

share|improve this question

You are using the Apple supplied python not the one installed via macports

Use sudo port select python ,python-version> to put the link to the correct python in /opt/local/bin/python

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .