>>> from setuptools import setup, Extension
>>> from torch.utils import cpp_extension
INFO: Could not find files for the given pattern(s).
And when I’m trying to use code here to compile a simple extension, I encountered this issue, which I suspect is related to the problem above. But I’m not sure what is it exactly.
UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified
I googled this issue but didn’t find a satisfactory answer.
The reason is that it needs to find the compiler for the cpp_extension, which is called cl. You should have VS 2017 installed, start “x64 Native Tools Command Prompt for VS 2017” and run python in that environment.
I do have cuda installed. I also have Visual Studio 2019 installed. But, I still get the following error. Any idea why?
C:\Users\myusername\AppData\Local\Continuum\anaconda3\envs\myenvname\lib\site-packages\torch\utils\cpp_extension.py:238: UserWarning: Error checking compiler version for cl: [WinError 2] The system cannot find the file specified
warnings.warn(‘Error checking compiler version for {}: {}’.format(compiler, error))