Networkx,AttributeError:'module'对象没有属性'all_simple_paths'

时间:2013-04-15 04:06:54

标签: python networkx

我是python-networkx的新用户,当我尝试all_shortest_paths函数时,它以某种方式显示错误here

ps:我已将networkx更新为最新版本

>>> import networkx as nx
>>> print nx.__version__
1.7
>>> G = nx.complete_graph(4)
>>> print nx.all_simple_paths(G, source=0, target=3, cutoff=2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'all_simple_paths'

谢谢! 包似乎安装得很好,我试过的其他功能都没有这个问题。

>>> print  help(nx)


NAME
    networkx

FILE
    /Library/Frameworks/Python.framework/Versions/7.2/lib/python2.7/site-packages/networkx/__init__.py

DESCRIPTION
    NetworkX
    ========

        NetworkX (NX) is a Python package for the creation, manipulation, and
        study of the structure, dynamics, and functions of complex networks.

        https://networkx.lanl.gov/

    Using
    -----

        Just write in Python

0 个答案:

没有答案