标签:pytorch www required _MSC_VER var install windows download print
pip install torch-scatter
# 报错
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
解决方法Microsoft Visual C++ 14.0 is required (Unable to find vcvarsall.bat)
也可以直接安装whl包:https://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
CUDA9.1 Visual Studio Integration 安装失败问题,如何解决? - 徐遥的回答 - 知乎
https://www.zhihu.com/question/276491276/answer/394778358 (有VS tools的早期版本)
pip install torch-scatter
# 报错
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include\crt/host_config.h(133): fatal error C1189: #error: -- unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported!
scatter_kernel.cu
error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v9.0\\bin\\nvcc.exe' failed with exit status 2
在C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include\crt\host_config.h
文件中有下面的代码筛选:
#if _MSC_VER < 1600 || _MSC_VER > 1911
因为安装的Visual Studio是2019的
// test.cpp
#include <stdio.h>
#include <Windows.h>
int main(){
printf("%d",_MSC_VER);
return 0;
}
打开x86_x64 Cross Tools Command Prompt for VS 2019
cl test.cpp # 编译
test.exe # 输出版本号1921
修改cuda配置的VS build tools信息好像不管用,使用下面的方法:
1 卸载VS 2019 Build tools
2 安装VS 2015 Build tools,该工具的_MSC_VER=1900
是MS VC++ 14.0
参考visual c++ build tools的安装与使用中的下载地址
$ pip install --verbose --no-cache-dir torch-scatter
$ pip install --verbose --no-cache-dir torch-sparse
$ pip install --verbose --no-cache-dir torch-cluster
$ pip install --verbose --no-cache-dir torch-spline-conv (optional)
$ pip install torch-geometric
安装成功!
标签:pytorch www required _MSC_VER var install windows download print
原文地址:https://www.cnblogs.com/ZeroTensor/p/10930031.html