I was doing exactly that yesterday and I think the problem may be gcc-8 (supposing you’re in Ubuntu 18.04 using the default packages) or pybind11 > 2.8 (something changed that broke SofaPython3). I would advise maybe try using gcc-9 and compiling pybind11 2.6.2.