OpenAI’s Spinning Up tutorial is a great resource, but its installation procedures aren’t so friendly for those on Mac OSX and using MacPorts instead of HomeBrew.

After struggling a bit trying to figure out how to install openmpi with MacPorts, I finally stumbled across this thread, which gave me an inkling as to where to go.

I kept on trying to run the pip install for the spinningup repo, but repeatedly hit this error when installing mpi4py.

_configtest.c:2:10: fatal error: 'mpi.h' file not found
#include <mpi.h>

It turns out I needed to install openmpi-devel AND activate it via MacPorts:

sudo port install openmpi-devel
sudo port select --set mpi openmpi-devel-mp-fortran

After this, all went well.