Thanks, I saw another post suggesting that same omission. Thus, in my case I’ve added that same line:

#include <signal.h>

to the file:

pytorch/caffe2/operators/crash_op.cc

and the pytorch build succeeded, but then the import failed:

$ python -c “import torch”
Traceback (most recent call last):
File “”, line 1, in 
File “torch/init.py”, line 17, in 
from ._six import string_classes as _string_classes
File “torch/_six.py”, line 23, in 
import builtins
ImportError: No module named builtins

Thus as posted in other fora, I then did the following:

pip install future

I then got the following result from the import attempt:

$ python -c “import torch”
Traceback (most recent call last):
File “”, line 1, in 
File “torch/init.py”, line 79, in 
from torch._C import *
ImportError: No module named _C

I then saw this thread 7, including the recommendation “Could you please try opening torch in any directory other than repo’s root?..”
Observing all this while that I had been in the pytorch directory, I simply cd’ed to the parent and the import now succeeds.

$ cd …
$ python -c “import torch”
$

Best,
CB