9

I'm trying to use mpi4py.

I have mpi4py installed from the Anaconda package, and

pip install mpi4py

recognizes this.

But when i run

from mpi4py import MPI

says MPI module doen't exist.

I've looked in the mpi4py folder and indeed i can't find it.

i think the problem is that i might not have OpenMPI installed, but i've been looking everywhere and i can't find how to install ir on Windows 10.

Please help.

Edit: The original question was about installing OpenMPI on windows 10 and use it with mpi4py, but since i found a way to run mpi4py with MSMPI i changed the title so people trying to do the same at least have a work-around.

alxg
  • 368
  • 1
  • 4
  • 15

3 Answers3

6

Set the MSMPI path (by default C:\Program Files\Microsoft MPI\Bin) in the %PATH% environment variable (http://www.computerhope.com/issues/ch000549.htm).

After that, you can launch your program by running the command:

mpiexec /np <number of process> python <your MPI4Py python script>
user6658022
  • 61
  • 1
  • 2
2

Not really a solution. But i found that installing MSMPI works with mpi4py. Even using the version distributed in Anaconda, with MSMPI works out of the box (as far as i've tried).

It's a solution to the mpi4py problem, though it's not installing the actual OpenMPI so it might not work for other languages and implementations.

alxg
  • 368
  • 1
  • 4
  • 15
  • i have installed msmpi (1.9) & mpisdk in windows 10 and did pip install mpi4py but still im getting the same error how did you solve your problem ? – ArigatoManga Aug 22 '19 at 06:51
0

you need to install mpihc. you have installed the mpi4py module, but can't execute it. check mphic.org