ModuleNotFoundError: No module named 'mpi4py'

#1
by Andyrasika - opened

I tried

python -m pip install git+https://github.com/mpi4py/mpi4py

but got error:

      _configtest.c:2:10: fatal error: mpi.h: No such file or directory
          2 | #include <mpi.h>
            |          ^~~~~~~
      compilation terminated.
      failure.
      removing: _configtest.c _configtest.o
      error: Cannot compile MPI programs. Check your configuration!!!
      Installing mpi4py requires a working MPI implementation.
      If you are running on a supercomputer or cluster, check with
      the system administrator or refer to the system user guide.
      Otherwise, if you are running on a laptop or desktop computer,
      your may be missing the MPICH or Open MPI development package:
      * On Fedora/RHEL systems, run:
        $ sudo dnf install mpich-devel     # for MPICH
        $ sudo dnf install openmpi-devel   # for Open MPI
      * On Debian/Ubuntu systems, run:
        $ sudo apt install libmpich-dev    # for MPICH
        $ sudo apt install libopenmpi-dev  # for Open MPI
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for mpi4py
Failed to build mpi4py
ERROR: Could not build wheels for mpi4py, which is required to install pyproject.toml-based projects

use command

deepspeed predict.py

then it works

Sign up or log in to comment