torch_scatter安装踩坑实录

news2024/11/15 17:19:11

由于运行代码出现如下报错

ModuleNotFoundError: No module named 'torch_scatter'

因此,在网上找到一篇博客【不好使】

pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.12.1+cu116.html
(match) F:\matchCode\SuperGlue_training-main>pip install torch-scatter -f https://pytorch-geometric.com/whl/torch-1.12.1+cu116.html
Looking in links: https://pytorch-geometric.com/whl/torch-1.12.1+cu116.html
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
  ╰─> [111 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-37
      creating build\lib.win-amd64-cpython-37\torch_scatter
      copying torch_scatter\placeholder.py -> build\lib.win-amd64-cpython-37\torch_scatter
      copying torch_scatter\scatter.py -> build\lib.win-amd64-cpython-37\torch_scatter
      copying torch_scatter\segment_coo.py -> build\lib.win-amd64-cpython-37\torch_scatter
      copying torch_scatter\segment_csr.py -> build\lib.win-amd64-cpython-37\torch_scatter
      copying torch_scatter\testing.py -> build\lib.win-amd64-cpython-37\torch_scatter
      copying torch_scatter\utils.py -> build\lib.win-amd64-cpython-37\torch_scatter
      copying torch_scatter\__init__.py -> build\lib.win-amd64-cpython-37\torch_scatter
      creating build\lib.win-amd64-cpython-37\torch_scatter\composite
      copying torch_scatter\composite\logsumexp.py -> build\lib.win-amd64-cpython-37\torch_scatter\composite
      copying torch_scatter\composite\softmax.py -> build\lib.win-amd64-cpython-37\torch_scatter\composite
      copying torch_scatter\composite\std.py -> build\lib.win-amd64-cpython-37\torch_scatter\composite
      copying torch_scatter\composite\__init__.py -> build\lib.win-amd64-cpython-37\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
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\utils\cpp_extension.py:346: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。
        warnings.warn(f'Error checking compiler version for {compiler}: {error}')
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\utils\cpp_extension.py:813: UserWarning: The detected CUDA version (11.7) has a minor version mismatch with the version that was used to compile PyTorch (11.6). Most likely this shouldn't be a problem.
        warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda))
      building 'torch_scatter._scatter_cpu' extension
      creating build\temp.win-amd64-cpython-37
      creating build\temp.win-amd64-cpython-37\Release
      creating build\temp.win-amd64-cpython-37\Release\csrc
      creating build\temp.win-amd64-cpython-37\Release\csrc\cpu
      "D:\Visual Studio Community 2015\VC\BIN\x86_amd64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DWITH_PYTHON -Dtorchscatter_EXPORTS -Icsrc -ID:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include -ID:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\torch\csrc\api\include -ID:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\TH -ID:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\THC -ID:\anaconda\AnacondaInstall\envs\match\include -ID:\anaconda\AnacondaInstall\envs\match\Include "-ID:\Visual Studio Community 2015\VC\INCLUDE" "-ID:\Visual Studio Community 2015\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tpcsrc\cpu\scatter_cpu.cpp /Fobuild\temp.win-amd64-cpython-37\Release\csrc\cpu\scatter_cpu.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -O3 -DAT_PARALLEL_OPENMP /openmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_scatter_cpu -D_GLIBCXX_USE_CXX11_ABI=0
      cl: 命令行 warning D9002 :忽略未知选项“-O3”
      scatter_cpu.cpp
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/macros/Macros.h(143) : warning C4067: 预处理器指令后有意外标记 - 应输入换行符
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : error C2146: 语法错误: 缺少“;”(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(44) : error C2146: 语法错误: 缺少“;”(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(44) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(44) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(45) : error C2146: 语法错误: 缺少“;”(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(45) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(45) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(46) : error C2146: 语法错误: 缺少“;”(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(46) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(46) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(47) : error C2146: 语法错误: 缺少“;”(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(47) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(47) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(48) : error C2146: 语法错误: 缺少“;”(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(48) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(48) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(49) : error C2146: 语法错误: 缺少“;”(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(49) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(49) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(50) : error C2146: 语法错误: 缺少“;”(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(50) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(50) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(51) : error C2146: 语法错误: 缺少“;”(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(51) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(51) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(52) : error C2146: 语法错误: 缺少“;”(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(52) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(52) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(53) : error C2146: 语法错误: 缺少“;”(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(53) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(53) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(54) : error C2146: 语法错误: 缺少“;”(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(54) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(54) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(55) : error C2146: 语法错误: 缺少“;”(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(55) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(55) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(56) : error C2146: 语法错误: 缺少“;”(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(56) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(56) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(57) : error C2146: 语法错误: 缺少“;”(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(57) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(57) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(58) : error C2146: 语法错误: 缺少“;”(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(58) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(58) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(61) : error C2144: 语法错误:“int”的前面应有“;”
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(61) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(61) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(73) : error C2057: 应输入常量表达式
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/util/C++17.h(27) : fatal error C1189: #error :  You need C++14 to compile PyTorch
      error: command 'D:\\Visual Studio Community 2015\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit code 2
      [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
  ╰─> [113 lines of output]
      running install
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\setuptools\command\install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        setuptools.SetuptoolsDeprecationWarning,
      running build
      running build_py
      creating build
      creating build\lib.win-amd64-cpython-37
      creating build\lib.win-amd64-cpython-37\torch_scatter
      copying torch_scatter\placeholder.py -> build\lib.win-amd64-cpython-37\torch_scatter
      copying torch_scatter\scatter.py -> build\lib.win-amd64-cpython-37\torch_scatter
      copying torch_scatter\segment_coo.py -> build\lib.win-amd64-cpython-37\torch_scatter
      copying torch_scatter\segment_csr.py -> build\lib.win-amd64-cpython-37\torch_scatter
      copying torch_scatter\testing.py -> build\lib.win-amd64-cpython-37\torch_scatter
      copying torch_scatter\utils.py -> build\lib.win-amd64-cpython-37\torch_scatter
      copying torch_scatter\__init__.py -> build\lib.win-amd64-cpython-37\torch_scatter
      creating build\lib.win-amd64-cpython-37\torch_scatter\composite
      copying torch_scatter\composite\logsumexp.py -> build\lib.win-amd64-cpython-37\torch_scatter\composite
      copying torch_scatter\composite\softmax.py -> build\lib.win-amd64-cpython-37\torch_scatter\composite
      copying torch_scatter\composite\std.py -> build\lib.win-amd64-cpython-37\torch_scatter\composite
      copying torch_scatter\composite\__init__.py -> build\lib.win-amd64-cpython-37\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
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\utils\cpp_extension.py:346: UserWarning: Error checking compiler version for cl: [WinError 2] 系统找不到指定的文件。
        warnings.warn(f'Error checking compiler version for {compiler}: {error}')
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\utils\cpp_extension.py:813: UserWarning: The detected CUDA version (11.7) has a minor version mismatch with the version that was used to compile PyTorch (11.6). Most likely this shouldn't be a problem.
        warnings.warn(CUDA_MISMATCH_WARN.format(cuda_str_version, torch.version.cuda))
      building 'torch_scatter._scatter_cpu' extension
      creating build\temp.win-amd64-cpython-37
      creating build\temp.win-amd64-cpython-37\Release
      creating build\temp.win-amd64-cpython-37\Release\csrc
      creating build\temp.win-amd64-cpython-37\Release\csrc\cpu
      "D:\Visual Studio Community 2015\VC\BIN\x86_amd64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DWITH_PYTHON -Dtorchscatter_EXPORTS -Icsrc -ID:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include -ID:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\torch\csrc\api\include -ID:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\TH -ID:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\THC -ID:\anaconda\AnacondaInstall\envs\match\include -ID:\anaconda\AnacondaInstall\envs\match\Include "-ID:\Visual Studio Community 2015\VC\INCLUDE" "-ID:\Visual Studio Community 2015\VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\8.1\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1\include\winrt" /EHsc /Tpcsrc\cpu\scatter_cpu.cpp /Fobuild\temp.win-amd64-cpython-37\Release\csrc\cpu\scatter_cpu.obj /MD /wd4819 /wd4251 /wd4244 /wd4267 /wd4275 /wd4018 /wd4190 /EHsc -O3 -DAT_PARALLEL_OPENMP /openmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_scatter_cpu -D_GLIBCXX_USE_CXX11_ABI=0
      cl: 命令行 warning D9002 :忽略未知选项“-O3”
      scatter_cpu.cpp
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/macros/Macros.h(143) : warning C4067: 预处理器指令后有意外标记 - 应输入换行符
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : error C2146: 语法错误: 缺少“;(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(44) : error C2146: 语法错误: 缺少“;(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(44) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(44) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(45) : error C2146: 语法错误: 缺少“;(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(45) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(45) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(46) : error C2146: 语法错误: 缺少“;(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(46) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(46) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(47) : error C2146: 语法错误: 缺少“;(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(47) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(47) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(48) : error C2146: 语法错误: 缺少“;(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(48) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(48) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(49) : error C2146: 语法错误: 缺少“;(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(49) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(49) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(50) : error C2146: 语法错误: 缺少“;(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(50) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(50) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(51) : error C2146: 语法错误: 缺少“;(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(51) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(51) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(52) : error C2146: 语法错误: 缺少“;(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(52) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(52) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(53) : error C2146: 语法错误: 缺少“;(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(53) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(53) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(54) : error C2146: 语法错误: 缺少“;(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(54) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(54) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(55) : error C2146: 语法错误: 缺少“;(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(55) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(55) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(56) : error C2146: 语法错误: 缺少“;(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(56) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(56) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(57) : error C2146: 语法错误: 缺少“;(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(57) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(57) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(58) : error C2146: 语法错误: 缺少“;(在标识符“DeviceType”的前面)
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(58) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(58) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(61) : error C2144: 语法错误:“int”的前面应有“;”
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(61) : error C4430: 缺少类型说明符 - 假定为 int。注意:  C++ 不支持默认 int
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(61) : error C2086: “int c10::constexpr”: 重定义
              D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(43) : 参见“c10::constexpr”的声明
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/core/DeviceType.h(73) : error C2057: 应输入常量表达式
      D:\anaconda\AnacondaInstall\envs\match\lib\site-packages\torch\include\c10/util/C++17.h(27) : fatal error C1189: #error :  You need C++14 to compile PyTorch
      error: command 'D:\\Visual Studio Community 2015\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit code 2
      [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.

正确命令

$ pip install  --no-index torch-scatter -f https://pytorch-geometric.com/whl/torch-1.12.1+cu116.html

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/709965.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Bootstrap 表格

文章目录 Bootstrap 表格基本的表格可选的表格类条纹表格边框表格悬停表格精简表格 上下文类响应式表格 Bootstrap 表格 Bootstrap 提供了一个清晰的创建表格的布局。下表列出了 Bootstrap 支持的一些表格元素&#xff1a; 标签描述<table>为表格添加基础样式。<thea…

学习笔记-图解HTTP

1 Web及网络基础 1.1 适用Http协议访问Web 在浏览器上输入网址然后访问指定的网页&#xff0c;浏览器就相当于是客户端&#xff0c;访问的网址就是指向特定的服务器。 HTTP协议&#xff1a;HyperText Transfer Protocol&#xff0c;超文本传输协议。 Web是建立在HTTP协议上…

MySQL8.0安装详细教程

前言&#xff1a; MySQL版本区别&#xff1a; ● MySQL Community Server&#xff1a;Community是社区版本&#xff0c;开源免费&#xff0c;但不提供官方技术支持&#xff1b; ● MySQL Enterprise Edition&#xff1a;Enterprise企业版本&#xff0c;需付费&#xff0c;可以…

剑指 Offer 数组中数字出现的次数

⭐️ 题目描述 &#x1f31f; leetcode链接&#xff1a;数组中数字出现的次数 ⭕️ 代码&#xff1a; /*思路&#xff1a;有两个出现单次的数字&#xff0c;其余数字都出现两次。把所有的数字分成两组&#xff0c;这两个数组分到不同的组&#xff0c;异或起来&#xff0c;就可…

力扣 108. 将有序数组转换为二叉搜索树

题目来源&#xff1a;https://leetcode.cn/problems/convert-sorted-array-to-binary-search-tree/description/ C题解1&#xff1a;递归法。由于要求是平衡树&#xff0c;又给出了递增数组&#xff0c;所以构建二叉树只需将中间值作为中间节点&#xff0c;左右两边分属左右子树…

无广告 齐全 简洁 免费的音乐开源软件(支持 电脑max win linux 手机 )——lxMusic

无广告 齐全 简洁 免费的音乐开源软件&#xff08;支持 电脑max win linux 手机 &#xff09;——lxMusic 话不多说先上效果 &#xff08;真香&#xff09; 下载地址&#xff08;官方&#xff09; https://www.lanzoui.com/b0bf2cfa/ 密码&#xff1a;glqw 软件安装包说明 文…

python接口自动化(五)--接口测试用例和接口测试报告模板(详解)

简介 当今社会在测试领域&#xff0c;接口测试已经越来越多的被提及&#xff0c;被重视&#xff0c;而且现在好多招聘信息要对接口测试提出要求。区别于传统意义上的系统级别测试&#xff0c;很多测试人员在接触到接口测试的时候&#xff0c;也许对测试执行还可以比较顺利的上手…

FDM3D打印系列——5、上色和灯光

3D打印扎古头可动并加灯 大家好&#xff0c;我是阿赵&#xff0c;这次通过一个实际操作的例子&#xff0c;来聊一下3D打印模型添加效果。这里主要讲2个方面&#xff0c;一个是上色&#xff0c;另一个是加灯光 一、上色 这个扎古头模型就是这次的主角。 1、打磨 可以看到&…

MIT 6.S081 教材第七章内容 -- 调度 -- 上

MIT 6.S081 教材第七章内容 -- 调度 -- 上 引言线程&#xff08;Thread&#xff09;概述XV6线程调度XV6线程切换实际切换流程 XV6进程切换示例程序yield/sched函数switch函数scheduler函数 补充 引言 MIT 6.S081 2020 操作系统 本文为MIT 6.S081课程第七章教材内容翻译加整理…

基于Python所写的飞鸟游戏设计

https://blog.csdn.net/qq_64505944/article/details/131493838?spm1001.2014.3001.5502

容器环境检测方法总结

在渗透测试过程中&#xff0c;我们的起始攻击点可能在一台虚拟机里或是一个Docker环境里&#xff0c;甚至可能是在K8s集群环境的一个pod里&#xff0c;我们应该如何快速判断当前是否在容器环境中运行呢&#xff1f; 当拿到shell权限&#xff0c;看到数字和字母随机生成的主机名…

(四)Qt 动态手势识别“手掌随动”+“握拳选择”

系列文章目录 通过Qt实现手势识别控制软件操作相关系列技术方案 &#xff08;一&#xff09;Qt 将某控件、图案绘制在最前面的方法&#xff0c;通过QGraphicsScene模块实现 &#xff08;二&#xff09;Qt QGraphicsScene模块实现圆点绘制在所有窗体的最前方&#xff0c;实现圆…

【java爬虫】使用selenium爬取优惠券

本文将介绍使用selenium爬取某宝优惠券的方法&#xff0c;之所以使用selenium是因为我不会js逆向&#xff0c;如果你已经参透了淘宝联盟的js逆向方法&#xff0c;那么直接使用接口调数据就行了。 使用selenium接管chrome浏览器 由于淘宝联盟需要先登录&#xff0c;为了避免每…

【剧前爆米花--爪哇岛寻宝】TCP实现可靠性的方法以及连接相关的三次握手四次挥手

作者&#xff1a;困了电视剧 专栏&#xff1a;《JavaEE初阶》 文章分布&#xff1a;这是一篇关于网络编程的文章&#xff0c;在这篇文章中我会具体介绍TCP是如何实现可靠性的并且分析建立断开连接的情况&#xff0c;希望对你有所帮助&#xff01; 目录 可靠性 确认应答 超时…

iOS开发进阶(一):走近iOS原生开发

文章目录 一、前言二、知识储备三、 Object-C四、启动流程五、拓展阅读 一、前言 在应用 uni-app 进行跨平台APP开发过程中&#xff0c;发现并不支持视频播放小窗功能&#xff0c;且插件市场提供的插件用户体验不好&#xff0c;遂决定自行开发 uni-app 原生插件。 uni-app原生…

力扣 450. 删除二叉搜索树中的节点

题目来源&#xff1a;https://leetcode.cn/problems/delete-node-in-a-bst/description/ C题解1&#xff1a;迭代法。删除节点需要分情况讨论&#xff1a; 找不到节点&#xff0c;返回原根节点&#xff1b;删除节点无子节点&#xff0c;那么其父节点指向空就行&#xff08;注意…

Java前端编译与优化

一个编译器的前端把*.java文件转变成*.class文件的过程称为Java前端编译。像Javac这类前端编译器对代码的运行效率几乎没任何优化措施&#xff0c;但是其做了许多针对Java语言编码过程的优化措施来降低程序员的编码复杂度、提供编码效率。 1 Javac编译器 准备过程 初始化插入…

《PyTorch深度学习实践》第十讲 卷积神经网络(基础篇)

b站刘二大人《PyTorch深度学习实践》课程第十讲卷积神经网络&#xff08;基础篇&#xff09;笔记与代码&#xff1a;https://www.bilibili.com/video/BV1Y7411d7Ys?p10&vd_sourceb17f113d28933824d753a0915d5e3a90 上一讲中MNIST数据集的例子采用的是全连接神经网络&#…

自然语言处理从入门到应用——预训练模型总览:两大任务类型

分类目录&#xff1a;《自然语言处理从入门到应用》总目录 从大量无标注数据中进行预训练使许多自然语言处理任务获得显著的性能提升。总的来看&#xff0c;预训练模型的优势包括&#xff1a; 在庞大的无标注数据上进行预训练可以获取更通用的语言表示&#xff0c;并有利于下游…

python语法(高阶)-多线程编程

""" 演示多线程编程的使用 """ import time import threadingdef sing(msg):while True:print(msg)time.sleep(1)return Nonedef dance(msg):while True:print(msg)time.sleep(1)return Noneif __name__ __main__:# 创建一个唱歌的线程&#xf…