from mpi4py import MPI dont work

Issue #67 closed
Former user created an issue

I use Python 2.7.11 in windows 7. I installed mpi4py using pip install mpi4py

It works if I just import mpi4py. But it is not working if I try to import MPI

import mpi4py from mpi4py import MPI

Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> from mpi4py import MPI ImportError: DLL load failed: The specified module could not be found.

Comments (11)

  1. Lisandro Dalcin

    Have you installed the Microsoft MPI runtime? If not, do it, otherwise mpi4py will not work at all, as the system MPI is not available.

  2. Mariyana Cholakova

    Hello, I have the same issue. However I have installed Microsoft MPI. Any advice how to resolve the issue?

    Thank you.

  3. Lisandro Dalcin

    @Mariyana Cholakova Could you provide additional information? Do you get the exact same error? Did you install the MS MPI runtime, or maybe just the SDK (you really need the runtime)? Did you install the lastest version of MS MPI? Did you install mpi4py with pip?

  4. Mariyana Cholakova

    The error is exactly the same- fails to import MPI :

    ‘from mpi4py import MPI ImportError: DLL load failed: The specified module could not be found.’

    I am using python 3.7.3, miniconda virtual environment and Windows 10. I installed MS MPI runtime (latest version from the official website) and mpi4py via pip. I also installed OpenMPI and made sure that the path to the installation folder is added to the PATH env variable(for the system, not only current user). Also tried by installing the SDK in addition but this did not help.

  5. Lisandro Dalcin

    Did you install Open MPI? How? I think they do not support Windows natively. Maybe you are using the Windows Subsystem for Linux (WSL)?

    The pre-built mpi4py binaries that are available to pip install are supposed to work with the official Python package from python.org, I never ever tested them with Miniconda Python, though I guess they should work. I do not have enough Windows expertise to figure out what might be wrong. Maybe you could try to use www.dependencywalker.com/ to figure out what’s the actual DLL that cannot be loaded, but not sure if that tool supports Windows 10.

    Maybe you should post this issue to our mailing list at Google Groups, some other Windows user can provide more useful insight about your issue.

  6. Mariyana Cholakova

    Thank you for the advice. Last question, if I decide to try on Linux, what are the steps required and is it possible without admin permission?

  7. Lisandro Dalcin

    Do you mean native Linux or under WSL? I never tried mpi4py in WSL (I’m not a Windows user). I expect it to work, but I’m not sure.

    If using Linux, then you should not need admin permissions. You can even install mpi4py quickly from the conda-forge channel.

  8. Mariyana Cholakova

    I meant native Linux(on a different computer) . I installed it and works with no problem on Linux installed with pip, thank you for the help again.

  9. Log in to comment