views:

190

answers:

1

Hi! I'm trying to use graphviz with python and I get the error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/pymodules/python2.6/gv.py", line 7, in <module>
    import _gv
ImportError: No module named _gv

The system state:

dpkg -l|grep graphviz
ii  graphviz              2.20.2-3ubuntu5      rich set of graph drawing tools
ii  libgraphviz4          2.20.2-3ubuntu5      rich set of graph drawing tools
ii  libgv-python          2.20.2-3ubuntu5      Python bindings for graphviz
ii  python-pygraphviz     0.99-2ubuntu1        Python interface to the Graphviz graph layou

I have Ubuntu 9.10 installed and python2.6

I searched at the internet and found out that probably it's symlink problem, but the workaround they suggested didn't work for me.

+4  A: 

I fixed the problem. The solution was:

sudo su   
cd /usr/lib/pyshared/python2.6 
mv _gv.so _gv.so- 
ln -s libgv_python.so _gv.so 
sys.path.append('/usr/lib/pyshared/python2.6')
Ivri