环境:macOS, python=3.5.6 torch=1.3.0
在
pip install torch-geometric
安装好torch-geometric之后,进入python编译器,运行from torch_geometric.data import data,报错:
ModuleNotFoundError: No module named 'torch_scatter'
解决方法:
参考文献【2】的解决方法:pip install --verbose --no-cache-dir torch-scatter torch-sparse torch-cluster torch-spline-conv,但是xcode gcc编译会出现问题。于是参考文献【1】的解决方法:
MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ pip install -i https://pypi.tuna.tsinghua.edu.cn/simple torch-scatter torch-sparse torch-cluster torch- spline-conv torch-geometric
参考文献:
【1】GCN, GAT, GraphSAGE 框架回顾及其 PyG 复现
【2】https://blog.csdn.net/u012939880/article/details/90241159