ModuleNotFoundError: No module named ‘torch_sparse‘
程序员文章站
2022-05-28 22:27:29
...
https://github.com/rusty1s/pytorch_sparse
1、
You can now install pytorch-sparse via Anaconda for all major OS/PyTorch/CUDA combinations ???? Given that you have pytorch >= 1.8.0 installed, simply run
conda install pytorch-sparse -c pyg
2、
PyTorch 1.10.0
To install the binaries for PyTorch 1.10.0, simply run
pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.10.0+${CUDA}.html
where ${CUDA} should be replaced by either cpu, cu102, or cu113 depending on your PyTorch installation.
我用的第二种方法,我的cuda是11.5,命令如下:
pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-1.10.0+cu113.html
查看pytorch版本:
import torch
print(torch.version) #注意是双下划线
上一篇: Fix PySide 导入问题 No module named ‘PySide‘
下一篇: ModuleNotFoundError: No module named 'torch_scatter.cuda'
推荐阅读
-
下载python中Crypto库报错:ModuleNotFoundError: No module named ‘Crypto’的解决
-
解决python "No module named pip"的问题
-
from dns.resolver import Resolver ImportError: No module named dns.resolver
-
Python 使用redis报:No module named redis问题
-
解决Python找不到ssl模块问题 No module named _ssl的方法
-
解决方法:在Python中使用Win32api报错的问题,No module named win32api
-
pycharm运行出现ImportError:No module named的解决方法
-
Python3中无法导入ssl模块的解决办法和python3.7 ModuleNotFoundError: No module named bz2解决办法
-
Django重装mysql后启动报错:No module named ‘MySQLdb’的解决方法
-
Centos7 执行firewall-cmd –permanent –add-service=mysql报错“ModuleNotFoundError: No module named 'gi'”