Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when installing mpi4py

I'm trying to install mpi4py using pip install mpi4py, but I'm getting the following error:

error: Cannot find 'mpi.h' header. Check your configuration!!!

Earlier in the same error report I have,

clang: error: linker command failed with exit code 1 (use -v to see    invocation)

What might the problem be?

Thanks!

like image 912
nargles324 Avatar asked Feb 10 '15 20:02

nargles324


3 Answers

As the error says, there are libraries missing. I solved it by installing libopenmpi-dev package

sudo apt-get install libopenmpi-dev

and then installed the mpi4py using pip

pip install mpi4py
like image 96
mcshell Avatar answered Nov 18 '22 18:11

mcshell


I met with the similar problem and fixed this by firstly

brew install mpich

And then

pip install mpi4py
like image 30
American curl Avatar answered Nov 18 '22 18:11

American curl


you can do this:

brew install mpich

then

sudo find / -name mpicc

finally

env MPICC=/yourpath/mpicc pip3 install mpi4py
like image 12
demonchang Avatar answered Nov 18 '22 20:11

demonchang