pyg安装——ERROR: Failed building wheel for torch-sparse

pyg安装——ERROR: Failed building wheel for torch-sparse

pyg安装的时候最开始还好好的,然后就出现torch-sparse安装出问题了,记录一下解决的办法


torch-sparse安装失败

最近做图神经网络,需要自己安装pyg
在安装好torch之后,我从网上找到了pyg的安装过程

pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.10.0+cpu.html
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.10.0+cpu.html
pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-1.10.0+cpu.html
pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.10.0+cpu.html
pip install torch-geometri

但是在安装torch-sparse包的时候出现了小问题:
ERROR: Failed building wheel for torch-sparse
在这里插入图片描述
看到了一个大神的解决办法:
解决方法:指定torch-sparse版本

解决方法:指定torch-sparse版本
pip install torch-sparse==0.6.13 -f https://pytorch-geometric.com/whl/torch-1.10.0+cu113.html 

试了试,成功了。

在这里插入图片描述

新的问题 : OSError: [WinError 127] 找不到指定的程序

就是另外的错
原因:根本原因是torch-scatter torch-sparse torch-cluster torch-spline-conv这些关联包跟torch版本不匹配
办法:需要把这些关联包重新装成关联的版本就行了。
具体如下:
(1)卸载掉之前装好的包:torch-scatter torch-sparse torch-cluster torch-spline-conv

pip uninstall  torch-scatter  torch-sparse torch-cluster torch-spline-conv

然后,输入pip list显示自己torch版本:(我在conda环境里输入的)
在这里插入图片描述
由于我的是CPU版本(电脑没有GPU),torch版本为1.13.0,所以我的输入是:(重点在后面的那部分torch-1.13.0+cpu.html)

pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.13.0+cpu.html
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.13.0+cpu.html
pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-1.13.0+cpu.html
pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.13.0+cpu.html
pip install torch-geometric

GPU版本可以参考文章:
彻底解决 OSError: [WinError 127] 找不到指定的程序

参考文献:
【图神经网络系列】基于cpu安装PyG
ERROR: Failed building wheel for torch-sparse

  • 11
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值