Dear Niall,
It seems to me the following line is critical:
src/dynload.c:5:10: fatal error: Python.h: No such file or directory
You want to have an appropriate package loaded. If you have the `module` command available,
you could try `module search python3-dev` or (`module search python-dev`), followed by `module load package_name`.
We can also see that you have openmpi loaded (`module list` will show you openmpi), but it is known to cause some issues, so you probably want to unload openmpi and load mpich.
Though it is not directly related to the error you are having right now, petsc usually requires some additional parameters when configuring on clusters (--with-batch
  (https://www.mcs.anl.gov/petsc/documentation/installation.html ),
--known-mpi-shared-libraries=0)
which we don't see in your previous email.
Were you able to test petsc on a compute node? If it worked on a computed node, I think it is fine.
Regards,
Koki
subprocess.CalledProcessError: Command '['/MYOB/r/libs/firedrake/bin/python', '-m', 'pip', 'install', '--no-binary', 'mpi4py,randomgen', '-vvv', '-r', 'PyOP2/requirements-ext.txt']' returned non-zero exit status 1.