Error loading MPI DLL in mpi4py

后端 未结 6 1809
面向向阳花
面向向阳花 2020-12-16 02:00

I am trying to use Mpi4py 1.3 with python 2.7 on Windows 7 64bits. I downloaded the installable version from here which includes OpenMPI 1.6.3 so in the installed directory

6条回答
  •  天命终不由人
    2020-12-16 02:50

    I had the same issue and no answer solved the issue.

    For me, the following solved the problem. I compiled and installed the mpi4py manually as follows:

    • Install MPI SDK 10 for Windows from https://duongtrungnghia.wordpress.com/2017/03/28/install-mpi4py-on-windows-10/
    • Add C:\Program Files (x86)\Microsoft SDKs\MPI\Lib and C:\Program Files (x86)\Microsoft SDKs\MPI to your Windows environment variables (not sure if needed)
    • You need Visual Studio Build Tools with MSVC 140 or pure Visual Studio. Not sure what version. In my case, the mpi4py setup.py used C:\Program Files (x86)\Microsoft Visual Studio 14.0\.... although I use VS2017 currently.
    • Install Windows SDK/Kits and dev tools (https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk)
      • Open Developer Command Prompt (It is like a CMD with some extras)
      • Activate your venv by executing (venv/Scripts/activate) if you use Virtualenv
      • Create and change to a temp directory and do the following:
        • git clone https://github.com/mpi4py/mpi4py.git
        • cd mpi4py
        • python -m pip install Cython
        • python setup.py build
        • python setup.py install

    My setting:

    • Windows 10
    • Python 3.7

提交回复
热议问题