Preparing to work with social networks in Python
One of Python's key advantages that merits repeating is the number of excellent pre-made packages available for the language; fortunately for us, network analysis is no exception. This short recipe will walk you through installing the libraries you'll need for the rest of this chapter.
Getting ready
The required external libraries for the tasks in this chapter are as follows:
- NetworkX
- matplotlib
- python-louvain
How to do it...
We will use the following steps that should be familiar at this point to prepare for the remaining recipes:
- Open a new Terminal or Command Prompt and change to your project directory.
- If you are using a virtual environment, activate your virtual environment and type the following:
pip install networkx
If you are not using a virtual environment, you will most likely need to use sudo
, as follows:
sudo pip install networkx
- Now, we must install the
python-louvain
package:
pip install python-louvain
How it works...
NetworkX is a well...