Parallel with MPI doesn`t work

I just test the i-tutorials parallel chapter in poisson_mpi.ipynb. When i run the third block it`s error in above line
if comm.rank == 0:
mesh = Mesh(unit_square.GenerateMesh(maxh=0.1).Distribute(comm))
else:
mesh = Mesh(netgen.meshing.Mesh.Receive(comm))

and the TypeError

How could i resolve that

Hi. I wonder if you have figured out what was happening here. I installed from source on my Linux system with configuration -DUSE_MPI=ON. However, I still have this problem.

Hi wan. I meet this problem when i using apt to install the NGSolve. And i solved this problem by installed from source.That’s intresting.In my opinion,u need to make sure your MPI and mpi4py is fine.
best, Moussa

Thanks! Would you mind telling me the platform of your linux (like Ubuntu) and if you are using openmpi or mpich? I am wondering if it is this subtlety leading to my failure.

My OS is Ubuntu18 64bits . And my MPI is Open MPI 2.1.1

Here you can find a step-by-step tutorial on how to install NGSolve with MPI support:
https://ngspetsc.readthedocs.io/en/latest/ngsPETSc.html
In particular, if you since MPI is install via PETSc you can choose to use either OpenMPI or MPICH (I test with Open MPI).
Also if you like to work in a container environment, here is the Docker file to build NGSolve with MPI support: https://github.com/NGSolve/ngsPETSc/blob/main/Dockerfile