I had followed the instructions mentioned by @albanD (https://github.com/pytorch/pytorch#from-source 2) before but assumed the system would have an at least somewhat recent set of compilers available. Turns out it didn’t and not only gcc but a proper c++ compiler was missing too, but

conda install -c conda-forge gcc cxx-compiler

Appears to have done the trick. I’m now waiting for the compilation to finish and hope my original problem which caused me to consider building pytorch from source will be solved to. Thank you for your help!