安装 torch-scatter,torch-sparse 出现error: Command errored out with exit status 1

在已安装PyTorch的情况下,安装torch-scatter和torch-sparse时遇到错误,如编译器版本检查失败、缺少Microsoft Visual C++等。解决方法包括直接从官方网站下载对应版本的whl文件,然后使用pip进行本地安装。确保下载的文件与系统、Python版本和CUDA版本匹配。如果缺少C++编译器,需下载并安装Visual Studio的C++ Build Tools。

部分内容参考文章,感谢这位博主

在已经正确安装pytorch的情况下,pip install torch-scatter, torch-sparse 仍然遇到问题, ERROR: Command errored out with exit status 1;

UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件;

ERROR: Failed building wheel for torch-scatter

等等一大串报错。那么可以尝试将whl文件下载至本地,然后pip install 安装。

网址:https://pytorch-geometric.com/whl/好对应的 torch+cpu/cuda版本

点进去选择匹配的 系统+python版本 的whl文件下载。

下载后,安装(假设存储在D盘download文件夹):

pip install "D:\download\torch_scatter-2.0.6-cp38-cp38-win_amd64.whl"
pip install "D:\download\torch_sparse-0.6.9-cp38-cp38-win_amd64.whl"

PS:如果出现Microsoft Visual C++ is required,那么根据提示的网址下载Visual Studio Installer,安装C++ Build Tools,就能解决。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值