torch-sparse安装报错,一直安装不上解决方法

torch-sparse安装

运行环境需要torch-geometric,下载安装完之后,再 pip install torch-sparse时,一直出错,安装不上

可能原因:需要先安装torch-sparse 和 torch_scatter,再安装torch-geometric才可以

找了很多解决方法,终于找到个可以解决的了,亲测有效

wget https://pytorch-geometric.com/whl/torch-1.5.0/torch_scatter-2.0.5%2Bcpu-cp37-cp37m-win_amd64.whl
pip install torch_scatter-2.0.5+cpu-cp37-cp37m-win_amd64.whl
wget https://pytorch-geometric.com/whl/torch-1.5.0/torch_sparse-0.6.6%2Bcpu-cp37-cp37m-win_amd64.whl
pip install torch_sparse-0.6.6+cpu-cp37-cp37m-win_amd64.whl
wget https://pytorch-geometric.com/whl/torch-1.5.0/torch_cluster-1.5.6%2Bcpu-cp37-cp37m-win_amd64.whl
pip install torch_cluster-1.5.6+cpu-cp37-cp37m-win_amd64.whl
wget https://pytorch-geometric.com/whl/torch-1.5.0/torch_spline_conv-1.2.0%2Bcpu-cp37-cp37m-win_amd64.whl
pip install torch_spline_conv-1.2.0+cpu-cp37-cp37m-win_amd64.whl
pip install torch-geometric
  • 需要根据自己电脑系统和anaconda环境来下载对应的版本,一定要看仔细了!!!
  • 下载whl文件的网址:pytorch-geometric官方下载地址
  • wget :该命令是根据指定文件网址下载指定文件,下载位置在当前目录下
  • pip install torch-geometric 根据下载的文件进行本地安装

你可能感兴趣的:(Pytorch,python)