pydot: 'Node' object has no attribute 'pos'

42 views
Skip to first unread message

Rekveld

unread,
Dec 12, 2009, 4:55:33 PM12/12/09
to networkx-discuss
Hi,

I am very new to this, so please excuse if this seems silly.

I installed GraphViz and PyDot, and now I am trying out some of the
examples from the Networkx site.
I am running the Python distribution from Enthought (2.5) on mac os
10.6.2
Whenever I try an example that should draw something, I get:

AttributeError: 'Node' object has no attribute 'pos'

might there be something wrong with my GraphViz installation ?
Any suggestions are very welcome !!

thanks,

Joost.

Christopher Ellison

unread,
Dec 12, 2009, 5:15:21 PM12/12/09
to networkx...@googlegroups.com
Rekveld wrote the following on 12/12/2009 01:55 PM:
> Hi,
>
> I am very new to this, so please excuse if this seems silly.
>
> I installed GraphViz and PyDot, and now I am trying out some of the
> examples from the Networkx site.
> I am running the Python distribution from Enthought (2.5) on mac os
> 10.6.2
> Whenever I try an example that should draw something, I get:
>
> AttributeError: 'Node' object has no attribute 'pos'
>
> might there be something wrong with my GraphViz installation ?

Please post the smallest code chunk you can make that demonstrates the
problem. The process of making your code chunk minimal is helpful in
that it often reveals mistakes (if any) that are your own, rather than
the library's.

Chris

Rekveld

unread,
Dec 12, 2009, 8:39:32 PM12/12/09
to networkx-discuss

Hi Chris, also here,

thanks a lot for your suggestions and help !

a small chunk would be:

G=nx.balanced_tree(3,5)
pos=nx.graphviz_layout(G,prog='twopi',args='')



Christopher Ellison

unread,
Dec 12, 2009, 8:52:17 PM12/12/09
to networkx...@googlegroups.com
Thanks! :)



That code runs without errors for me. What versions are you running?

>>> networkx.__version__
'1.0.dev1494'

>>> pygraphviz.__version__
'1.0.dev1384'

Can you also post the full traceback?

Chris

Rekveld

unread,
Dec 12, 2009, 9:49:20 PM12/12/09
to networkx-discuss

ok.
Discovered I was running a very old version of networkx (0.36, don't
know where that came from !), so that's better now.

and I was puzzled by the discrepancy between:
"This example needs Graphviz and either PyGraphviz or Pydot"
and the fact that in the code I did see some dependency on pygraphviz

after the update i get a tracebakc saying that it will not work
without pygraphviz, which makes sense, since I still have problems
installing it. I was hoping to get things to work with pydot alone..

thanks,

Joost.
Reply all
Reply to author
Forward
0 new messages