There’s an issue open for this, here: https://github.com/pytorch/pytorch/issues/3050 120
My understanding is that the gcc provided by conda doesn’t build pytorch (I’m assuming you installed that with conda install gcc.
For now, you can do the following:

conda uninstall gcc
Install a gcc on your system. Preferably 4.9. Mine is 4.8.5 and it works as well.
Try to python setup.py install. I think what’ll happen is that something will complain that it can’t find the right compilers, at which point you can symlink your local system gcc and g++ to the respective places.