import troch_geometric时报错Traceback (most recent call last): File “<stdin>“, line 1, in <module>...
望舒* 2024-10-02 08:01:06 阅读 59
此时报错建议在我已经通过源代码逐一下载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成功。
上一篇: 【AI驱动TDSQL-C Serverless 数据库技术实战营】体验教程傻瓜版
下一篇: ESP32-S3百度文心一言大模型AI语音聊天助手(支持自定义唤醒词训练)【手把手非常详细】【万字教程】
本文标签
in <module>... import troch_geometric时报错Traceback (most recent call last): File “<stdin>“ line 1
声明
本文内容仅代表作者观点,或转载于其他网站,本站不以此文作为商业用途
如有涉及侵权,请联系本站进行删除
转载本站原创文章,请注明来源及作者。