Error installing mpi4py

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

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

Earlier in the same error report I,

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

What could be the problem?

Thanks!

+6
source share
4 answers

I met a similar problem and fixed it, firstly

 brew install mpich 

And then

 pip install mpi4py 
+6
source

If mpi4py cannot find mpi.h, the problem is probably how you point mpi4py to the existing mpi library.

 $ python setup.py build --mpicc=/where/you/have/mpicc 

Now there are a few special cases related to OS X. You should consult http://mpi4py.scipy.org/docs/usrman/install.html to see if it applies to you.

+3
source

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

 sudo apt install libopenmpi-dev 

and then installed mpi4py using pip

 sudo pip install mpi4py 
+2
source

You can do it:

 brew install mpich 

then

 sudo find / -name mpicc 

finally,

 env MPICC=/yourpath/mpicc pip3 install mpi4py 
+1
source

Source: https://habr.com/ru/post/982291/


All Articles