So I need to use mpi4py to run a module. After manually installed mpi4py and add the path to mpi4py package to python search path through sys.path.append() command in .pythonrc. And I tried to import mpi4py in the interpreter and it works fine, no matter where the interpreter is invoked:
$ python
Python 2.7.4 (default, May 23 2013, 17:15:02)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from mpi4py import MPI
>>> MPI
<module 'mpi4py.MPI' from '/home/XXXX/yt-x86_64/src/mpi4py-1.3/build/lib.linux-x86_64-2.7/mpi4py/MPI.so'>
Then I tried to run from command line which a python script containing from mpi4py import MPI. It can't find the module:
$ python run_rockstar2.py
Traceback (most recent call last):
File "run_rockstar2.py", line 1, in <module>
from mpi4py import MPI
ImportError: No module named mpi4py
I've checked that I'm using the same python in the two cases. Anyone has a clue about this?
Thanks in advance.