![](https://img-blog.csdnimg.cn/img_convert/8c15e9fa771c421af0779297f5288d99.png)
禁止使用下面方法安装DGL,这种方法会更新你的pytorch版本,环境越变越乱
pip install dgl
第一步:进入DGL官网:Deep Graph Library (dgl.ai)检查自己的CUDA版本
![](https://img-blog.csdnimg.cn/img_convert/795b5e87e808982d5c528942e83c2564.png)
比如我的是python=3.8, pytorch=1.11.0, cuda=1.11.3
安装pip安装方式:
# If you have installed dgl-cuXX package, please uninstall it first.
pip install --pre dgl -f https://data.dgl.ai/wheels/cu113/repo.html
pip install --pre dglgo -f https://data.dgl.ai/wheels-test/repo.html