Error when installing mpi4py

nargles324 picture nargles324 · Feb 10, 2015 · Viewed 31.4k times · Source

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!

Answer

mcshell picture mcshell · Jan 25, 2017

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

sudo apt install libopenmpi-dev

and then installed the mpi4py using pip

sudo pip install mpi4py