Unable to install apex on windows, can’t find compiler

  apex, c++, pytorch

According to apex doc:

Windows support is experimental, and Linux is recommended. pip install -v –no-cache-dir –global-option="–cpp_ext" –global-option="–cuda_ext" .

I have no choice but to use Windows because Cuda on wsl2 is not in a stable windows version for now I followed the line and I got the following error :

UserWarning: Error checking compiler version for cl: [WinError 2] Le
fichier spécifié est introuvable
warnings.warn(‘Error checking compiler version for {}: {}’.format(compiler, error))

Then I look into the cpp_extension file, the try element was the following:

minimum_required_version = MINIMUM_MSVC_VERSION

        compiler_info = subprocess.check_output(compiler, stderr=subprocess.STDOUT)

        match = re.search(r'(d+).(d+).(d+)', compiler_info.decode().strip())

And I found that the compiler_info declaration was giving the error,
I have C/C++ version 19.27.29111 for cl.exe but I’m thinking the fetching of the compiler is what goes wrong, has anyone experienced this kind of behavior, I’m not understanding well the versions of visual studio so I downloaded these:

MSVC v142 - VS 2019 C++ x64/x86 Build Tools (v14.27)
SDK Windows 10 (10.0.17763.0)
MSVC v141 - VS 2017 C++ x64/x86 Build Tools (v14.16)
SDK CRT (runtime C) universel pour Windows
MSVC v140 – VS 2015 C++ Build Tools (v14.00)

cuda version: 10.2
torch version: 1.6
python version: 3.8

Source: Windows Questions C++