I want to run a mpi4py test file in terminal but it failed.
The operating system is mac and I am using anaconda2 with a python3. I installed mpi4py through anaconda environment. It works will on Pycharm, which also uses the anaconda environment.
The test code is:
from mpi4py import MPI
comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
node_name = MPI.Get_processor_name() # get the name of the node
print ('Hello world from process %d at %s.' % (rank, node_name))
and I run this in terminal: mpirun -np 5 python test.py
the error message is :
Traceback (most recent call last): File "test.py", line 3, in from mpi4py import MPI ImportError: No module named mpi4py Traceback (most recent call last): File "test.py", line 3, in from mpi4py import MPI ImportError: No module named mpi4py Traceback (most recent call last): File "test.py", line 3, in from mpi4py import MPI ImportError: No module named mpi4py Traceback (most recent call last): File "test.py", line 3, in from mpi4py import MPI ImportError: No module named mpi4py Traceback (most recent call last): File "test.py", line 3, in from mpi4py import MPI
ImportError: No module named mpi4py
mpirun noticed that the job aborted, but has no info as to the process