Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is import gv in python?

I installed easy_install under windows, and installed pygraph but the commad import gv in the example taken from here doesn't work:

What is gv lib? what import gv does?

I get this error :

Traceback (most recent call last):
  File "C:\Python27\graph.py", line 11, in <module>
    import gv
ImportError: No module named gv

All the other imports works fine

like image 299
0x90 Avatar asked Feb 26 '12 11:02

0x90


People also ask

What is GV in Python?

gv is GraphViz and apparently something with the place or the bindings of this library is wrong. You might have to modify sys.

What is graphviz in python?

Graphviz is an open-source python module that is used to create graph objects which can be completed using different nodes and edges. It is based on the DOT language of the Graphviz software and in python it allows us to download the source code of the graph in DOT language.


3 Answers

Try to install libgv-python with your package manager. On Ubuntu:

sudo apt-get install libgv-python
like image 65
maciekb Avatar answered Oct 14 '22 15:10

maciekb


This could have multiple problem sources:

  1. While installing, something went wrong and the module couldn't be installed.
  2. You haven't set your Python Path correctly.
  3. @second example: The module pygraph.readwrite could exists, but it's possible that it hasn't got a submodule called dot.

Of course there are sure other possibile problems, but I think this would be the most likely.

Edit: Have a look at this. Looks like it's the same problem as yours.

For the second problem eventually this discussion may also help.

like image 45
evotopid Avatar answered Oct 14 '22 15:10

evotopid


This seems to be a common issue with python-graph, see the discussion at http://code.google.com/p/python-graph/issues/detail?id=15. gv is GraphViz and apparently something with the place or the bindings of this library is wrong. You might have to modify sys.path, but it might be even more troublesome on Windows.

like image 28
Jan Pöschko Avatar answered Oct 14 '22 16:10

Jan Pöschko