创建conda环境记录——个人

我的CUDA版本为:12.6,最高支持12.6
在这里插入图片描述

1.创建虚拟环境

我之前安装的就是3.10.0,所以还是用它

conda create -n dgl_1 python=3.10.0

删除环境:

conda remove -n 【name】--all

2.安装torch

为方便起见,安装已经验证成功的版本(cuda=12.1),torch版本是2.3.0

torch与torchaudio的对应关系
torch与torchvision的对应关系
torch与torchtext的对应关系
torch与torchdata的对应关系

当已经装好torch包时,pip install torchvision torchaudio会自动寻找对应的版本安装。

conda install pytorch=2.3.0 torchvision=0.18.0 torchaudio=2.3.0 pytorch-cuda=12.1 -c pytorch -c nvidia

3. 安装 torch_geometric及其依赖

支持版本:下载链接
在这里插入图片描述
在终端进入这个四个安装包所在的目录,直接执行(卸载也用pip)

pip install torch_cluster-1.6.3+pt23cu121-cp310-cp310-win_amd64.whl torch_scatter-2.1.2+pt23cu121-cp310-cp310-win_amd64.whl torch_sparse-0.6.18+pt23cu121-cp310-cp310-win_amd64.whl torch_spline_conv-1.2.2+pt23cu121-cp310-cp310-win_amd64.whl

或 把四个安装包放在同一目录下(

pip install D:\installation_package\torch\torch_cluster_scatter_sparse_spline___pt23cu121_cp310\torch_cluster-1.6.3+pt23cu121-cp310-cp310-win_amd64.whl 
pip install D:\installation_package\torch\torch_cluster_scatter_sparse_spline___pt23cu121_cp310\torch_scatter-2.1.2+pt23cu121-cp310-cp310-win_amd64.whl 
pip install D:\installation_package\torch\torch_cluster_scatter_sparse_spline___pt23cu121_cp310\torch_sparse-0.6.18+pt23cu121-cp310-cp310-win_amd64.whl
pip install D:\installation_package\torch\torch_cluster_scatter_sparse_spline___pt23cu121_cp310\torch_spline_conv-1.2.2+pt23cu121-cp310-cp310-win_amd64.whl

指令链接

安装torch_geometric

conda install pyg -c pyg

or

pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.3.0+cu121.html

pip install torch_geometric

4. 安装dgl库

进入dgl网站
在这里插入图片描述

直接运行

conda install -c dglteam/label/cu121 dgl

5.安装其它库

conda install scikit-learn tqdm pandas matplotlib 
pip install sortednp

6.安装jupyter

conda install ipykernel
# 完成后验证
python -m ipykernel --version

# 为jupyter添加内核
python -m ipykernel install --user --name=【内核真名】 --display-name 【在内核选择时显示的内核假名】

7.pycharm配置环境

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
选择创建的环境python.exe即可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

qq_41824788

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值