Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在雪豹上。我有python 2.6。我通过“easy_install networkx”安装了networkx,然后使用从站点下载的包卸载并重新安装。每次安装都不会让我到任何地方:当我这样做时:“import networkx”我只是得到一个空响应,没有任何反应。有什么线索吗?
如果什么都没发生,那就意味着它起作用了。如果安装没有成功,就会出现如下错误:
>>> import networkx Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named networkx
试试代码:
G=networkx.Graph() G.add_edge(1, 2) print G.nodes()
你应该看到它有效(打印[1, 2])。
[1, 2]