Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Sage has Networkx built in as one of its backends for graphs. (Is this a Sage question?)

$ sage -python
Python 2.7.5 (default, Aug  1 2013, 18:11:00) 
[GCC 4.7.3] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import networkx as nx
>>> G = nx.Graph()
>>>

This should work fine, also in regular Python if you have the right things installed as you say. The "bash" in your error message indicates to me that you are not running Python (though I'm not sure how you got the first line to work in that case!).

If that's not the problem, can you give us an exact terminal output of what you did, in addition to what version of Sage you are using, etc.?