djhenderson / python-graph

Automatically exported from code.google.com/p/python-graph
Other
0 stars 0 forks source link

cannot import pygraph.readwrite.dot #94

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.import pygraph.readwrite.dot  
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named dot

What is the expected output? What do you see instead?
Should have the 'dot' module in the pygraph so that the graph can be saved as a 
dot string

What version of the product are you using? On what operating system?
pygraph 1.8.0
OS: Ubuntu 10.10

Please provide any additional information below.

Original issue reported on code.google.com by khoshgof...@gmail.com on 6 May 2011 at 3:14

GoogleCodeExporter commented 9 years ago
How did you install pygraph? Via apt-get or via pypi?

You see, python graph is distributed in two packages: python-graph-core and 
python-graph-dot. You'll need to install them both to get dot up and running. 

Original comment by tomaz.ko...@gmail.com on 6 May 2011 at 2:51

GoogleCodeExporter commented 9 years ago
I have got them both from pypi using easy_install (sudo easy_install 
python-graph-core, and sudo easy_install python-graph-dot), but when I try to 
'import pygraph.readwrite.dot', I get 'ImportError: No module named dot'
I'm actually trying to use 'pygraph.readwrite.dot.write()' which I believe was 
in pygraph 1.7, but it seems that it has been moved to somewhere else in 1.8. 
so I don't know the correct 'import' to use this function.

Original comment by khoshgof...@gmail.com on 6 May 2011 at 3:07

GoogleCodeExporter commented 9 years ago
pygraph.readwrite.dot.write hasn't been moved anywhere in 1.8
see: 
http://code.google.com/p/python-graph/source/browse/tags/release-1.8.0/dot/pygra
ph/readwrite/dot.py#107

I've just installed both packages on the same OS using pip and or easy_install 
and everything works super smooth (including dot).

I'm pretty sure this is not a problem on our side and I would be very grateful 
if you could prove me wrong.

BTW: Are you using python >= 2.6? 

tip:
- uninstall your current python graph packages
- use $ virtualenv your_env --no-site-packages 
- install pip
- do $ pip install -E ./your_env python-graph-core
- do $ pip install -E ./your_env python-graph-dot
- do $ source ./your_env/bin/activate
- open python
- do >>> import pygraph.readwrite.dot

Original comment by tomaz.ko...@gmail.com on 6 May 2011 at 11:44

GoogleCodeExporter commented 9 years ago
Thanks!
It's working now.
Seems that the problem was with a conflict due to having to versions of pygraph 
at the same time. It's fixed now.

Original comment by khoshgof...@gmail.com on 7 May 2011 at 12:35

GoogleCodeExporter commented 9 years ago

Original comment by tomaz.ko...@gmail.com on 7 May 2011 at 12:52