ImportError: No module named networkx
mrgloom opened this issue · 4 comments
mrgloom commented
After sudo pip install pymaxflow
on Ubuntu 14.04
Using this example:
https://github.com/pmneila/PyMaxflow/blob/master/examples/binary_restoration.py
I get error:
python binary_restoration.py
Traceback (most recent call last):
File "binary_restoration.py", line 19, in <module>
graph = g.get_nx_graph()
File "maxflow/src/_maxflow.pyx", line 448, in _maxflow.GraphInt.get_nx_graph (maxflow/src/_maxflow.cpp:3390)
ImportError: No module named networkx
mrgloom commented
Problem solved with: sudo pip install networkx
pmneila commented
Hi,
Yes, networkx is an optional package for PyMaxflow since it is only used in the function get_nx_graph, which is there for debugging purposes. That's why it is not included in the dependencies and not installed when you install PyMaxflow.
However, you can install it manually as you did if you need to call get_nx_graph.
Regards.
alma-frankenstein commented
Also, anyone using python3 might try installing it with pip3.
tanghui0102 commented