pip install -q torch-geometric 报错: “……Microsoft Visual C++ 14.0 is required……” 解决办法

1. 现象:

1.1 import torch_geometric 缺包

1.2 安装包pip install -q torch-geometric

报错“……Microsoft Visual C++ 14.0 is required……

2.原因

电脑没装Microsoft Visual C++ 14.0以上版本

3. 措施 

3.1 微软官网https://my.visualstudio.com/Downloads?q=visual%20studio%202015&wt.mc_id=o~msft~vscom~older-downloads搜索“visual studio 2019”(更高版本,我没试过)

3.2 下载安装visual studio 2019

注:一定要选择“使用C++的桌面开发”→勾选右侧可选项前3项

3.3 重启计算机

3.4 重新pip安装torch-geometric:

pip install -q torch-cluster -f https://pytorch-geometric.com/whl/torch-1.13.1+cpu.html
pip install -q torch-scatter -f https://pytorch-geometric.com/whl/torch-1.13.1+cpu.html  
pip install -q torch-sparse -f https://pytorch-geometric.com/whl/torch-1.13.1+cpu.html   
pip install -q torch-spline_conv -f https://pytorch-geometric.com/whl/torch-1.13.1+cpu.html
pip install -q torch-geometric
 

注:“1.13.1”根据你自己的本地的torch版本选择,如果版本不匹配可能会有异常。

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值