How to upgrade networkx to developer version in Linux

Weight functions are only available on networkx development version.
To install it you need to do the following:

git clone
cd networkx
sudo python install

ERROR: Failure: ImportError (No module named coverage)
ImportError: No module named pandas

To fix it, install these libraries and re-run nesetest:

sudo pip install pandas coverage
Ran 3045 tests in 33.191s


If you run your python console you can ask for networkx version as follows:

Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import networkx
>>> print networkx.__version__


But, if you run your code it still be using version 1.1
Now you need to remove the previous version and re-install the last version:

sudo pip uninstall networkx
sudo python install

Enjoy it!


Popular posts from this blog

from: can't read /var/mail/ in Python scripts

Fix "Set scan parameters failed: Input/output error" on Ubuntu 16.04

How to install a WhatsApp bot based on Python