1

This is a tutorial about visualizing network diagrams using Google Cloud Datalab.

Everything worked perfectly (needs to change "gcp.bigquery" to "datalab.bigquery" in [25]) until:

In [35]:

%%bash
/usr/bin/yes | apt-get install graphviz
pip install --upgrade graphviz
/usr/bin/yes | pip uninstall pyparsing
pip install -Iv https://pypi.python.org/packages/source/p/pyparsing/pyparsing-1.5.7.tar.gz
pip install --upgrade pydot

Once I uninstalled pyparsing, the pip command cannot work and the next 2 lines cannot be executed correctly.

If I ignore the lines related to pyparsing, just install/upgrade graphviz and pydot, an error will occur at this line in "In [67]:" :

pos=nx.graphviz_layout(gmax, prog='circo')

AttributeError: 'module' object has no attribute 'graphviz_layout'

I don't think it is a pyparsing matter. Maybe the graphviz version is the point, since this tutorial was written about 2 years ago.

Any idea about it?

Thanks

illright
  • 3,991
  • 2
  • 29
  • 54
Zrisound
  • 43
  • 1
  • 3
  • 1
    Possible duplicate of [AttributeError: 'module' object has no attribute 'graphviz\_layout' with networkx 1.11](http://stackoverflow.com/questions/39411102/attributeerror-module-object-has-no-attribute-graphviz-layout-with-networkx) – snakecharmerb Apr 15 '17 at 10:31

1 Answers1

3

The network graph displayed correctly after I changed

pos=nx.graphviz_layout(gmax, prog='circo')

to

pos=nx.nx_pydot.graphviz_layout(gmax, prog='circo')

based on this StackOverflow post. This required pydotplus so I also updated one of the cells with %%bash. I ran

%%bash
apt-get update
apt-get install -y graphviz
pip install pydot
pip install graphviz
pip install pydotplus

instead of

%%bash
/usr/bin/yes | apt-get install graphviz
pip install --upgrade graphviz
/usr/bin/yes | pip uninstall pyparsing
pip install -Iv https://pypi.python.org/packages/source/p/pyparsing/pyparsing-1.5.7.tar.gz
pip install --upgrade pydot

I hope this helps!

Community
  • 1
  • 1
Anthonios Partheniou
  • 1,699
  • 1
  • 15
  • 25