Need help to locate subpackages

Hi there,

I am new to the graph-tool module. I downloaded the precomplied module from
repository and import graph_tool on python. Everything worked out fine,
except that I can't use any of the subpackages listed on the documentation
(because they were not there). I would really like to use the 'draw' and
'topology' subpackages. Can be someone tell me where to download them or how
to import them?

Many thanks,

Hi Will

I don't think that there are any sub packages. Everything is one package
here. A good way to start is to try the examples from the documentation.
There are lots of examples there for drawing and for other stuff too. I
found it very helpful.

If you have a specific problem, we will need some information. The exact
error message, the exact version of graph-tools, python, operating system
that you are using, the code that you wrote and explanation of what do you
expect from that code.

If you're new to python but you know some basic programming take a look at
how classes work.

If you have any problems feel free to ask :wink:

Have fun :wink:


attachment.html (2.83 KB)

Found it!
It turned out I have to import the subpackages first before I want to use
them. As first I was trying to use gt.topology but it told me there wasn't
such an attribute.

Look at:

First line:

from graph_tool.all import *

It's good to walk through at least over the basics :wink:


attachment.html (1.86 KB)

Hi :slight_smile:

Maybe this answer is more helpful, as I can understand that `from
graph-tool.all import *` might clutter your namespace, especially if you're
using other graph analysis packages in parallel (it's also not necessarily
considered good practice to do so.)

I figured that

import graph-tool.all as gt

should give you the behaviour you were expecting (understandably if you look
at a lot of examples in the docs). At least it does so far for me.



Hi Felix,

Many thanks for your reply. Right now I'm just using "import graph_tool.topology as topo", so that I don't have to type too much in my codes. :stuck_out_tongue:


attachment.html (3 KB)