当前位置:首页 » 《资源分享》 » 正文

import troch_geometric时报错Traceback (most recent call last): File “<stdin>“, line 1, in <module>...

18 人参与  2024年10月05日 13:20  分类 : 《资源分享》  评论

点击全文阅读


此时报错建议在我已经通过源代码逐一下载torch-scatter, torch-sparse, torch-cluster成果之后,然后下载torch_geometric发现成果下载,import 时弹出报错川口

无法定位程序输入点
 python . exe -无法 到入口
 x? get @ lntType @c10@@ SA ? AV ?$ shared _ ptr @ UIntType @c10@@
@ std @@ XZ 于动态链接库
 PyCharm 
 E :VAnaconda3\ envs \ pytestNib \ site - packages \ torch scatter versi on _ cuda . pyd ±.

重新安装时报错:(base) C:\Users\11914>pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.9.0+cu111.html Looking in links: https://pytorch-geometric.com/whl/torch-1.9.0+cu111.html Collecting torch-scatter Downloading torch_scatter-2.1.1.tar.gz (107 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 107.6/107.6 kB 624.2 kB/s eta 0:00:00 Preparing metadata (setup.py) ... done Building wheels for collected packages: torch-scatter Building wheel for torch-scatter (setup.py) ... error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [33 lines of output] No CUDA runtime is found, using CUDA_HOME='E:\CUDA DEVELOPMENT' running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-3.7 creating build\lib.win-amd64-3.7\torch_scatter copying torch_scatter\placeholder.py -> build\lib.win-amd64-3.7\torch_scatter copying torch_scatter\scatter.py -> build\lib.win-amd64-3.7\torch_scatter copying torch_scatter\segment_coo.py -> build\lib.win-amd64-3.7\torch_scatter copying torch_scatter\segment_csr.py -> build\lib.win-amd64-3.7\torch_scatter copying torch_scatter\testing.py -> build\lib.win-amd64-3.7\torch_scatter copying torch_scatter\utils.py -> build\lib.win-amd64-3.7\torch_scatter copying torch_scatter\__init__.py -> build\lib.win-amd64-3.7\torch_scatter creating build\lib.win-amd64-3.7\torch_scatter\composite copying torch_scatter\composite\logsumexp.py -> build\lib.win-amd64-3.7\torch_scatter\composite copying torch_scatter\composite\softmax.py -> build\lib.win-amd64-3.7\torch_scatter\composite copying torch_scatter\composite\std.py -> build\lib.win-amd64-3.7\torch_scatter\composite copying torch_scatter\composite\__init__.py -> build\lib.win-amd64-3.7\torch_scatter\composite running egg_info writing torch_scatter.egg-info\PKG-INFO writing dependency_links to torch_scatter.egg-info\dependency_links.txt writing requirements to torch_scatter.egg-info\requires.txt writing top-level names to torch_scatter.egg-info\top_level.txt reading manifest file 'torch_scatter.egg-info\SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no previously-included files matching '*' found under directory 'test' writing manifest file 'torch_scatter.egg-info\SOURCES.txt' running build_ext e:\anaconda3\lib\site-packages\torch\utils\cpp_extension.py:358: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。 warnings.warn(f'Error checking compiler version for {compiler}: {error}') building 'torch_scatter._scatter_cpu' extension error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/ [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for torch-scatter Running setup.py clean for torch-scatter Failed to build torch-scatter ERROR: Could not build wheels for torch-scatter, which is required to install pyproject.toml-based projects

在尝试重新下载torch失败之后,我问了查老师(chatgpt)发现在C++环境下无需指明版本下载,这时首先下载VSC++开发工具,链接下载链接

然后下载之后依次运行如下命令:

pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.6.0+cpu.html
pip install torch-sparse -f https://pytorch-geometric.com/whl/torch-1.6.0+cpu.html
pip install torch-cluster -f https://pytorch-geometric.com/whl/torch-1.6.0+cpu.html
pip install torch-spline-conv -f https://pytorch-geometric.com/whl/torch-1.6.0+cpu.html
pip install torch-geometric

再次import成功。


点击全文阅读


本文链接:http://m.zhangshiyu.com/post/167970.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1