The install docs show you several ways to install networkx
. pip is one of the easiest ways to get python packages installed (managing dependencies and updates etc).
On debian systems you can install pip by running:
sudo apt-get install python3-pip
(note that there are typically different packages for pip3 and for pip2)
and then you should be able to install networkx as follows:
sudo pip3 install networkx
If you use windows maybe read How do I install pip on Windows? to get started with pip.