2

Besides the mpi4py package, conda-forge is also offering a msmpi package which is probably intended to be used with the mpi4py package.

This is probably the reason why installing mpi4py on the Anaconda Prompt (Anaconda3) on Windows 10 (Microsoft) gives the following error message:

if exist "C:\Windows\System32\msmpi.dll" (
echo "You seem to have a system wide installation of MSMPI. "
 echo "Due to the way DLL loading works on windows, system wide installation "
 echo "will probably overshadow the conda installation. Uninstalling "
 echo "the system wide installation and forced deleting C:\Windows\System32\msmpi*.dll"
 echo "will help, but may break other software using the system wide installation."
)

This file is indeed present after the installation of Microsoft MPI and it's path gets appended to the PATH variable by the installer.

I uninstalled the system-wide Microsoft MPI installation, but it didn't solve the problem (error message).

I followed the instructions and renamed (also tried deleting) C:\Windows\System32\msmpi.dll (as well as C:\Windows\System32\msmpires.dll as suggested by another website), but the error message remains.

In addition, my Python script aborts with the error message

MPI_Win_allocate shared (...) failed

What additional diagnostics could I run in order to pin down the problem?

A related question can be found on How to prevent local msmpi installation from loading system wide msmpi.dll, but renaming msmpi.dll seemed to help in this case.

There is also a C:\Windows\SysWOW64\msmpi.dll and C:\Windows\SysWOW64\msmpires.dll which I renamed, but also this didn't help.

What's strange, that How to install mpi4py on Windows 10 with msmpi suggests that MS-MPI actually has to be installed to install mpi4py.

NicolasBourbaki
  • 853
  • 1
  • 6
  • 19

1 Answers1

0

Here is my solution:

I try to create a new environment named test, and then activate it, which doesn't report the error. What can we get from this? This problem probably shouldn't be solved by the instructions. This error occurs only in this environment.

So, I find the directory of my environment, and the delete two files, located at environment/etc/conda/deactivate.d/ and environment/etc/conda/activate.d.

General Grievance
  • 4,555
  • 31
  • 31
  • 45
nick
  • 11
  • This fixed the issue for me. I already uninstalled MPI and renamed the dll. Still was getting this error, deleting the to msmpi files in the two directories fixed the issue. Not sure why this was downvoted. – user1957292 Sep 01 '23 at 23:05