PyTorch Geometric安装问题:torch-scatter返回退出状态1如何解决
torch-scatter 安装失败解决方案
- 先升级基础依赖工具,避免旧版本pip无法匹配预编译包
pip install --upgrade pip setuptools wheel
- 卸载已有的残次torch-scatter版本
pip uninstall -y torch-scatter
- 绑定版本执行安装,避免拉取需要源码编译的高版本torch-scatter
pip install torch-scatter==2.0.9 -f https://pytorch-geometric.com/whl/torch-1.8.1+cpu.html
- 若上述步骤仍报错,直接离线安装对应预编译wheel包
选择和你系统匹配的wheel文件:- Windows系统:
torch_scatter-2.0.9-cp37-cp37m-win_amd64.whl - Linux系统:
torch_scatter-2.0.9-cp37-cp37m-linux_x86_64.whl
下载到本地后执行安装:
pip install 本地wheel文件的完整路径 - Windows系统:
- 安装完成后执行验证,正常输出版本号即为安装成功
python -c "import torch_scatter; print(torch_scatter.__version__)"
补充说明:如果是Windows系统需要源码编译,需要提前安装Microsoft Visual C++ Build Tools,优先使用预编译包可跳过该依赖安装。
内容的提问来源于stack exchange,提问作者Sai_Vyas
相关产品推荐
相关产品推荐

