Graphviz + python... issues

Discussion in 'OT Technology' started by Kull, Jun 4, 2008.

  1. Kull

    Kull OT Supporter

    Joined:
    Nov 20, 2006
    Messages:
    2,913
    Likes Received:
    0
    Location:
    Pullman, WA
    For the life of me I can get any of the python interfaces, I guess you could call em interfaces, to graphviz to work.

    pyDot (http://dkbza.org/pydot.html)
    yapgvb (yet another python graphviz binding) (http://yapgvb.sourceforge.net/)
    pyGraphviz (https://networkx.lanl.gov/wiki/pygraphviz)
    mfGraph (http://mfgraph.sourceforge.net/)
    or a couple others.


    I cant either get them to build properly, or various other problems and I'm getting really really frustrated.

    yapgvb has a windows installer, and requires boost.python to be installed as well, so I figured, fine two windows installers, no problems right? Wrong.

    I get
    Code:
    File "C:\Python25\lib\site-packages\yapgvb\__init__.py", line 20, in <module>
        from _yapgvb import *
    ImportError: DLL load failed: The specified module could not be found.
    You can bypass this by removing the _ from _yapgvb, I have a feeling thats an error being thrown up by komodo, but after you remove that it throws more errors.

    Code:
    File "C:\Python25\lib\site-packages\yapgvb\__init__.py", line 20, in <module>
        from yapgvb import *
      File "C:\Python25\lib\site-packages\yapgvb\__init__.py", line 35, in <module>
        _implement_graph_attributes(_init_graph_attributes(CGraph, ClusterBase, Node, Edge, SubgraphBase))
    NameError: name 'CGraph' is not defined
    I'm using python 2.5, I have wxPython installed, and am using Komodo to do the debugging, but that shouldn't make much difference. Im running windows xp.

    Does anyone by chance have experience working with any of these tools before?

    Thanks in advance for any help you can give...

    If you wana try it out for yourself you can get graphviz and python from here.
    - GraphViz - (http://www.graphviz.org/)
    - Python2.5 - (http://www.python.org/download/)
     
  2. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Is there any way to use something other than Python? Like VBA, for example?

    Shit on it all you want, but ArcGIS offers Python and VBA, and AutoCAD offers LISP and VBA, and once they both added VBA to their scripting lineups, all development using Python and LISP stopped cold.
     
  3. Kull

    Kull OT Supporter

    Joined:
    Nov 20, 2006
    Messages:
    2,913
    Likes Received:
    0
    Location:
    Pullman, WA
    Ive already written 95% of the program in python :sadwavey:
     
  4. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Bah. Fie, even.
     
  5. Kull

    Kull OT Supporter

    Joined:
    Nov 20, 2006
    Messages:
    2,913
    Likes Received:
    0
    Location:
    Pullman, WA
    Either that or does anyone have a suggestion of something I could use other than graphviz to generate coordinates a graph. Basically I have a huge tree which I am storing in a dictionary.

    dictTree = {
    1 : [2,3,4,5],
    2 : [4,5],
    3 : [6,7],
    etc...
    }
    where 1 points to 2,3,4,5 and 2 points to 4,5.. etc...

    And was hoping I could just tap into graphviz to do all the node plotting and spline plotting for me, then I could just take the graphical data and draw it myself using python. Anyone know of a similar open source algorithm, or library I could use for something like this?
     
  6. tyrionlannister

    tyrionlannister New Member

    Joined:
    Jun 13, 2006
    Messages:
    710
    Likes Received:
    0
    Location:
    New York
    Make sure the dll directory is included in the environment's PATH variable.

    import os; print os.environ['PATH']
     

Share This Page