Error when installing mpi4py

后端 未结 7 1983
死守一世寂寞
死守一世寂寞 2021-02-02 07:19

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!!!
<         


        
相关标签:
7条回答
  • 2021-02-02 08:00

    If somebody stumbles by and has the same problem I had:

    I wanted to install mpi4py using pip as root:

    sudo pip install mpi4py
    

    I got the error message that mpi.h was missing during the installation. The path was set correctly, but only for my user, not for root. So if you run into trouble with missing libraries/headers during any installation, make sure the correct environment is also set up for root.

    As I use mpi-selector to select which mpi implementation you use, I just had to run mpi-selector as root to set up everything correctly, and the installation succeeded.

    0 讨论(0)
  • 2021-02-02 08:11

    None of the above solutions worked for me. I just use the conda install:

    brew install mpich
    
    conda install mpi4py
    
    
    0 讨论(0)
  • 2021-02-02 08:12

    I met with the similar problem and fixed this by firstly

    brew install mpich
    

    And then

    pip install mpi4py
    
    0 讨论(0)
  • 2021-02-02 08:18

    you can do this:

    brew install mpich
    

    then

    sudo find / -name mpicc
    

    finally

    env MPICC=/yourpath/mpicc pip3 install mpi4py
    
    0 讨论(0)
  • 2021-02-02 08:19

    first post here and new to python , sorry if im off topic.

    i finally installed mpi4py

    1) by downloading the right version from here https://www.lfd.uci.edu/~gohlke/pythonlibs/#mpi4py

    2) open cmd ,change directory to where the downloaded file is

    3) pip install some-package.whl ( How do I install a Python package with a .whl file? )

    0 讨论(0)
  • 2021-02-02 08:23

    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
    
    0 讨论(0)
提交回复
热议问题