Mpi4py installation error: cannot compile MPI programs. Check your configuration!!!

ubuntu/Linux

sudo apt install libopenmpi-dev
pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ mpi4py

mac

brew install mpich
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ mpi4py

Read More: