# 安装 jupyter+networkx+pyvis+matplotlib

查看当前 python 版本

```plaintext
$ python -V
Python 3.13.5
```

查找 python 版本 VS Miniconda 版本关系

```plaintext
https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/
```

下载二者对应的 conda 版本脚本

```plaintext
$ wget https://repo.anaconda.com/miniconda/Miniconda3-py313_25.5.1-1-Linux-x86_64.sh
```

并不需要加 sudo 权限执行脚本

```plaintext
$ sh Miniconda3-py313_25.5.1-1-Linux-x86_64.sh
```

按照提示，退出重开 shell 才能生效。再次确认 python 版本未变

```plaintext
(base) $ python -V
Python 3.13.5
```

直接使用 conda 安装 jupyter，而非使用 apt-get install 安装

```plaintext
$ conda install jupyter
```

确认安装成功并打开

```plaintext
$ jupyter notebook
```

升级pip

```plaintext
(base)$ python -m pip install --upgrade pip
Successfully installed pip-25.2
                                                                                                                             
(base)$ pip --version                      
pip 25.2 from /miniconda3/lib/python3.13/site-packages/pip (python 3.13)
```

使用pip安装pandas+matplotlib+xlrd+networkx+pyvis+python-louvain，更换清华源

```plaintext
$ pip install pandas -i https://pypi.tuna.tsinghua.edu.cn/simple 

$ pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple

$ pip install xlrd -i https://pypi.tuna.tsinghua.edu.cn/simple   

$ pip install networkx -i https://pypi.tuna.tsinghua.edu.cn/simple 

$ pip install pyvis -i https://pypi.tuna.tsinghua.edu.cn/simple 

$ pip install python-louvain -i https://pypi.tuna.tsinghua.edu.cn/simple
```

参考文章

```plaintext
http://www.360doc.com/content/23/0202/18/41651190_1065926781.shtml

https://blog.51cto.com/u_16123336/13587387

https://www.modb.pro/db/177195

https://blog.51cto.com/u_15069487/2581491

https://towardsdatascience.com/building-interactive-network-graphs-using-pyvis-5b8e6e25cf64/

https://blog.51cto.com/u_16213397/7061255

https://developer.baidu.com/article/details/2623478

https://cloud.tencent.com/developer/article/2364325

https://qiniu.pattern.swarma.org/pdf/arxiv/2006.04951.pdf
```
