環境: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