I'm trying to build an application to visualize a network in plotly. However, my pygraphviz installation seems to be giving me trouble. Every time I try to run code, it gives me the error "AttributeError: module 'pygraphviz' has no attribute 'AGraph'"
I'm using the Anaconda distribution and I've tried installing pygraphviz using several different channels but it always gave me the same error. I ended up manually downloading the .whl file and installing it using pip as shown in:
howto install pygraphviz on windows 10 64bit
I'm running a windows 10 64 bit machine with python version 3.4. Here's an example of some code I tried to run (copied from the examples folder in the pygraphviz installation):
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
import pygraphviz as pgv
A=pgv.AGraph(directed=True,strict=True,rankdir='LR')
A.add_node(1,color='red')
A.add_node(5,color='blue')
A.add_edge(1,2,color='green')
A.add_edge(2,3)
A.add_edge(1,3)
A.add_edge(3,4)
A.add_edge(3,5)
A.add_edge(3,6)
A.add_edge(4,6)
A.graph_attr['epsilon']='0.001'
print(A.string()) # print dot file to standard output
A.layout('dot') # layout with dot
A.draw('foo.ps') # write to file
This gives me the error "AttributeError: module 'pygraphviz' has no attribute 'AGraph'". Any help would be appreciated!