Install Networkx in Python 3.7 environment for use in malware data science books

Install Networkx in Python 3.7 environment

I used it in a malware data science book, but I will leave it because it was different from when it was published and the explanation of the installation method was complicated. The environment is Linux Mint, Python 3.7 is already installed, and the environment was built using pipenv.

First, you'll need libgraphviz-dev and Python 3.7-dev to install. Also, pygraphviz is required, so you need to install it together.

sudo apt install libgraphviz-dev python3.7-dev
pipenv install networkx pygraphviz

I think that python3.7-dev needs to match the version of Python you are using. The code worked for the time being.

Postscript

Since the usage of Networkx has changed a little, I will also describe it. The way to add node and edge attributes has changed.

network = networkx.Graph()

#Add node and set attributes
network.add_node(1)
network.add_node(2)
network.nodes[1]['attribute'] = 'value'

#Add edge and set attributes
network.add_edge(1, 2)
network[1][2]['attribute'] = 'value'

There should be no problem with the above method.

Recommended Posts

Install Networkx in Python 3.7 environment for use in malware data science books
install tensorflow in anaconda + python3.5 environment
How to use "deque" for Python data
Use pathlib in Maya (Python 2.7) for upcoming Python 3.7
Books on data science to read in 2020
(For myself) Flask_AWS_1 (Install PHP, MySQL, phpMyAdmin, Python in AWS virtual environment)
Quickly build a python environment for deep learning and data science (Windows)
Install the python package in an offline environment
Install Python 3.5.1 + numpy + scipy + α in Windows environment
Display candlesticks for FX (forex) data in Python
Use Python in your environment from Win Automation
Don't use readlines () in your Python for statement!
Use jupyter-lab installed in python virtual environment (venv)
Use Python in Anaconda environment with VS Code
Use pydantic when reading environment variables in Python
Use os.getenv to get environment variables in Python
Use data class for data storage of Python 3.7 or higher
Use config.ini in Python
Create your own Big Data in Python for validation
Build an interactive environment for machine learning in Python
Use dates in Python
Use Python installed with pyenv for PL / Python execution environment
[For beginners] Install the package in the Anaconda environment (Janome)
Use the CASA Toolkit in your own Python environment
Use kintone API SDK for Python on Raspberry Pi (easily store data in kintone from Raspberry Pi)
virtual environment in python
Stop thinking for use in data analysis competition LightGBM
Let's use the open data of "Mamebus" in Python
Use profiler in Python
Development environment in Python
Use AWS SDK for Python (boto) under Proxy environment
Install Python (for Windows)
Python environment for projects
Check the operation of Python for .NET in each environment
Building a development environment for Android apps-creating Android apps in Python
Dockerfile for creating a data science environment based on pip3
[Understand in the shortest time] Python basics for data analysis
Data science companion in python, how to specify elements in pandas
Install CaboCha in Ubuntu environment and call it with Python.
Let's use def in python
Handle Ambient data in Python
Use Anaconda in pyenv environment
Use Measurement Protocol in Python
Python for Data Analysis Chapter 4
Install Python environment with Anaconda
Use callback function in Python
Use parameter store in Python
Display UTM-30LX data in Python
Use HTTP cache in Python
Search for strings in Python
Use MongoDB ODM in Python
Use list-keyed dict in Python
Pip install in proxy environment
Data Science Cheat Sheet (Python)
Python environment construction For Mac
Techniques for sorting in Python
Use Random Forest in Python
Use regular expressions in Python
My python data analytics environment
Python3 environment construction (for beginners)
Use Spyder in Python IDE