problem in repeating the circular tree example

198 views
Skip to first unread message

Pengyao Jiang

unread,
Apr 3, 2016, 12:33:22 AM4/3/16
to networkx-discuss
Hi there,

I'm very new to networkx. I have netwrokx version 1.11, python version 2.7.11 (under anaconda environment). I tried to repeat circular tree the example (http://networkx.github.io/documentation/latest/examples/drawing/circular_tree.html). However, when it tried to import graphviz_layout function, it failed. It says it needs Graphviz and either PyGraphviz or Pydot. I installed Graphviz and PyGraphviz, but the I still get the same error. I also tried to install Pydot, it seems to have bugs or issues here and there. I am just wondering what exactly needs to be installed (and what version?) in order make this example work? Thank you!!!

Daniel Schult

unread,
Apr 3, 2016, 12:30:43 PM4/3/16
to networkx...@googlegroups.com
Did you install everything for the same environment within anaconda? Sometimes you end up installing python packages into the system python environment, etc.

Did you run the tests for pygraphviz (import pygraphviz; pygraphviz,test())? Can you show us the error you are getting? Did you get the Graphviz libraries or just the executable?  If I recall, pygraphviz doesn't have a conda package, did you use pip to install or is there a pygraphviz package now? 

On Fri, Apr 1, 2016 at 5:40 PM, Pengyao Jiang <pyji...@gmail.com> wrote:
Hi there,

I'm very new to networkx. I have netwrokx version 1.11, python version 2.7.11 (under anaconda environment). I tried to repeat circular tree the example (http://networkx.github.io/documentation/latest/examples/drawing/circular_tree.html). However, when it tried to import graphviz_layout function, it failed. It says it needs Graphviz and either PyGraphviz or Pydot. I installed Graphviz and PyGraphviz, but the I still get the same error. I also tried to install Pydot, it seems to have bugs or issues here and there. I am just wondering what exactly needs to be installed (and what version?) in order make this example work? Thank you!!!

--
You received this message because you are subscribed to the Google Groups "networkx-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to networkx-discu...@googlegroups.com.
To post to this group, send email to networkx...@googlegroups.com.
Visit this group at https://groups.google.com/group/networkx-discuss.
For more options, visit https://groups.google.com/d/optout.

Pengyao Jiang

unread,
Apr 4, 2016, 6:27:39 PM4/4/16
to networkx-discuss
Hi,

Yes, I did install everything for the same environment within anaconda, not the system python environment. 

I can run the  pygraphviz.test() without any problem. I noticed the example code was temporarily modified last Friday into:

try:
    import pygraphviz
    from networkx.drawing.nx_agraph import graphviz_layout
except ImportError:
    try:
        import pydotplus
        from networkx.drawing.nx_pydot import graphviz_layout
    except ImportError:
        raise ImportError("This example needs Graphviz and either "
                          "PyGraphviz or PyDotPlus")

In this case, I can run the example without any problem. I guess the old import:

try:
    from networkx import graphviz_layout
except ImportError:
    raise ImportError("This example needs Graphviz and either PyGraphviz or Pydot")

tried to use pydot, which I don't successfully installed. 

Daniel Schult

unread,
Apr 4, 2016, 6:35:48 PM4/4/16
to networkx...@googlegroups.com
Got it.... yes - we fixed a namespace issue in PR #1930 in January because of the namespace collision between using pydot and pygraphviz in graphviz_layout.

Sorry for the confusion.  I'm not sure how the change would happen last Friday. Is it working for you now?

Pengyao Jiang

unread,
Apr 4, 2016, 6:41:16 PM4/4/16
to networkx-discuss
Yes, it is working for me now! Thanks!
Reply all
Reply to author
Forward
0 new messages