安装pytorch-geometric-temporal总是报错

问题描述:

安装pytorch-geometric-temporal总是报错,报错如下:

(pytorchGT) C:\Users\A>pip install torch_scatter
Collecting torch_scatter
  Using cached torch_scatter-2.1.1.tar.gz (107 kB)
  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]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-38
      creating build\lib.win-amd64-cpython-38\torch_scatter
      copying torch_scatter\placeholder.py -> build\lib.win-amd64-cpython-38\torch_scatter
      copying torch_scatter\scatter.py -> build\lib.win-amd64-cpython-38\torch_scatter
      copying torch_scatter\segment_coo.py -> build\lib.win-amd64-cpython-38\torch_scatter
      copying torch_scatter\segment_csr.py -> build\lib.win-amd64-cpython-38\torch_scatter
      copying torch_scatter\testing.py -> build\lib.win-amd64-cpython-38\torch_scatter
      copying torch_scatter\utils.py -> build\lib.win-amd64-cpython-38\torch_scatter
      copying torch_scatter\__init__.py -> build\lib.win-amd64-cpython-38\torch_scatter
      creating build\lib.win-amd64-cpython-38\torch_scatter\composite
      copying torch_scatter\composite\logsumexp.py -> build\lib.win-amd64-cpython-38\torch_scatter\composite
      copying torch_scatter\composite\softmax.py -> build\lib.win-amd64-cpython-38\torch_scatter\composite
      copying torch_scatter\composite\std.py -> build\lib.win-amd64-cpython-38\torch_scatter\composite
      copying torch_scatter\composite\__init__.py -> build\lib.win-amd64-cpython-38\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'
      adding license file 'LICENSE'
      writing manifest file 'torch_scatter.egg-info\SOURCES.txt'
      running build_ext
      E:\SoftWares\anaconda3\envs\pytorchGT\lib\site-packages\torch\utils\cpp_extension.py:316: 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 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [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
Installing collected packages: torch_scatter
  Running setup.py install for torch_scatter ... error
  error: subprocess-exited-with-error

  × Running setup.py install for torch_scatter did not run successfully.
  │ exit code: 1
  ╰─> [35 lines of output]
      running install
      E:\SoftWares\anaconda3\envs\pytorchGT\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-38
      creating build\lib.win-amd64-cpython-38\torch_scatter
      copying torch_scatter\placeholder.py -> build\lib.win-amd64-cpython-38\torch_scatter
      copying torch_scatter\scatter.py -> build\lib.win-amd64-cpython-38\torch_scatter
      copying torch_scatter\segment_coo.py -> build\lib.win-amd64-cpython-38\torch_scatter
      copying torch_scatter\segment_csr.py -> build\lib.win-amd64-cpython-38\torch_scatter
      copying torch_scatter\testing.py -> build\lib.win-amd64-cpython-38\torch_scatter
      copying torch_scatter\utils.py -> build\lib.win-amd64-cpython-38\torch_scatter
      copying torch_scatter\__init__.py -> build\lib.win-amd64-cpython-38\torch_scatter
      creating build\lib.win-amd64-cpython-38\torch_scatter\composite
      copying torch_scatter\composite\logsumexp.py -> build\lib.win-amd64-cpython-38\torch_scatter\composite
      copying torch_scatter\composite\softmax.py -> build\lib.win-amd64-cpython-38\torch_scatter\composite
      copying torch_scatter\composite\std.py -> build\lib.win-amd64-cpython-38\torch_scatter\composite
      copying torch_scatter\composite\__init__.py -> build\lib.win-amd64-cpython-38\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'
      adding license file 'LICENSE'
      writing manifest file 'torch_scatter.egg-info\SOURCES.txt'
      running build_ext
      E:\SoftWares\anaconda3\envs\pytorchGT\lib\site-packages\torch\utils\cpp_extension.py:316: 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 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> torch_scatter

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

解决方案:

缺少torch_scatter和torch_sparse,这两个文件由于已经安装pytorch而无法pip 安装,需要自己下安装包去安装,
下载两个文件,按照这个博客一步步操作就行
https://blog.csdn.net/qq_43481435/article/details/127212104

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值