CPP extension with python2.7 and python 3.6

I’m compiling a pytorch library (faster rcnn) with CPP extension (pytorch 1.0 and latest cpp extension method).

The code can compile and run with python 2.7, but it fails to compile with python 3.6. Here is the compilation error:

/home/ubuntu/anaconda3/envs/fasterrcnn_py36/lib/python3.6/site-packages/torch/lib/include/torch/extension.h:4:23: fatal error: torch/all.h: No such file or directory

I am wondering if there are any way to fix this error?


Did you installed pytorch the same way your did for python 2.7? Make sure there is no old version of pytorch present before installing a new one.