Catalyst Python example Import Error no module named mpi4py

Hi all! I’ve been trying to run the catalyst python full example but keep running into the same error.

I ran:
<local>/superbuild/catalyst/build/bin/pvpython fedriver.py cpscript.py

I got:

Traceback (most recent call last):
  File "fedriver.py", line 19, in <module>
    from mpi4py import MPI
ImportError: No module named mpi4py

I built catalyst from the superbuild (version 5.6.2), and I added environment variables to PATH as according to the instructions at the top of the python example (in fedriver.py). This alleviated my problems with numpy, but oddly enough not mpi.

Any help would be appreciated, thank you in advance!

@nicolas.vuaille

Did you enable the MPI option in the ParaView superbuild? If you did, you may need to run pvpython with the --mpi flag or alternately run with pvbatch instead.

I enabled catalyst, cxx11, mpi, numpy, png, and python in the superbuild, but not use system mpi.
I got the same import error with pvbatch and using the --mpi flag with pvpython.

I’m not at a place where it’s easy for me to check on the superbuild options but is there an mpi4py CMake option in the superbuild? It may be an advanced option. Also, are you using your system’s Python? I can’t remember all of the details with Python in the superbuild.

I’m using the 5.6.2 version of catalyst and there’s no mpi4py option during CMake. I didn’t enable USE_SYSTEM_python, so I believe it’s using the superbuild’s python.

Are you on windows by chance? mpi4py was not packaged by the Superbuild (and thus our binaries either) up through 5.6 on windows, but was on Mac and Linuxe. I would have to check on the status after 5.7 with windows.

In any case building from source against a system Python that has mpi4py should work everywhere.

I am using Ubuntu Linux. I could not find the option even in advanced settings, but it’s possible that I missed it somehow.
Regardless, I am now using newer versions, and will post again if I have trouble then.