I'm a beginner in python, and i'm trying to draw a graph using:
`nx.write_dot(G, "%s.dot"%(image))`
in a defined function. When I excute the program, I'm getting this error:
File "sim.py", line 31, in <module>
main()
File "sim.py", line 30, in main
sol.run()
File "C:\Python27\My sim\Solution.py", line 221, in run
self.drawGraph(G, "solution1")
File "C:\Python27\My sim\Solution.py", line 227, in drawGraph
nx.write_dot(G, "%s.dot"%(image))
File "<decorator-gen-232>", line 2, in write_dot
File "C:\Python27\lib\site-packages\networkx\utils\decorators.py", line 220, in _open_file
result = func(*new_args, **kwargs)
File "C:\Python27\lib\site-packages\networkx\drawing\nx_pydot.py", line 58, in write_dot
P=to_pydot(G)
File "C:\Python27\lib\site-packages\networkx\drawing\nx_pydot.py", line 197, in to_pydot
P = pydot.Dot(graph_type=graph_type,strict=strict,**graph_defaults)
AttributeError: 'module' object has no attribute 'Dot'
It seems it is a Windows os problem (I'm on win7), because my colleague can run the same script on his ubuntu machine without any error.
Thanks for any help!