Error loading MPI DLL in mpi4py
up vote
4
down vote
favorite
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 (*/Python27Libsite-packagesmpi4pylib) following libraries exist: libmpi.lib, libmpi_cxx.lib, libopen-pal.lib, and libopen-rte.lib. Now in my codes when trying to import it:
from mpi4py import MPI
It returns following error:
ImportError: DLL load failed: The specified module could not be found. I tried to copy a bove lib files alongside the */Python27Libsite-packagesmpi4pyMPI.pyd and even to Windows/System32, but it didn't work. I appreciate your help on what DLL is missing and how to fix the error?
Thanks,
@Aso.agile
python python-2.7 openmpi
add a comment |
up vote
4
down vote
favorite
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 (*/Python27Libsite-packagesmpi4pylib) following libraries exist: libmpi.lib, libmpi_cxx.lib, libopen-pal.lib, and libopen-rte.lib. Now in my codes when trying to import it:
from mpi4py import MPI
It returns following error:
ImportError: DLL load failed: The specified module could not be found. I tried to copy a bove lib files alongside the */Python27Libsite-packagesmpi4pyMPI.pyd and even to Windows/System32, but it didn't work. I appreciate your help on what DLL is missing and how to fix the error?
Thanks,
@Aso.agile
python python-2.7 openmpi
*.lib are either static library archives or import libraries. These are definitely not DLLs.
– Hristo Iliev
Dec 23 '12 at 9:16
Thanks @HristoIliev for your comment.You right *.lib are static library which in this case OpenMPI is provided in form of. Then what DLL is missing?
– Aso Agile
Dec 23 '12 at 12:40
Sorry, never used mpi4py, lest on Windows. Check the installation directory. May be there is a bitness mismatch (there were some Windows installation problems discussed recently on the Open MPI mailing lists...)
– Hristo Iliev
Dec 23 '12 at 20:50
add a comment |
up vote
4
down vote
favorite
up vote
4
down vote
favorite
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 (*/Python27Libsite-packagesmpi4pylib) following libraries exist: libmpi.lib, libmpi_cxx.lib, libopen-pal.lib, and libopen-rte.lib. Now in my codes when trying to import it:
from mpi4py import MPI
It returns following error:
ImportError: DLL load failed: The specified module could not be found. I tried to copy a bove lib files alongside the */Python27Libsite-packagesmpi4pyMPI.pyd and even to Windows/System32, but it didn't work. I appreciate your help on what DLL is missing and how to fix the error?
Thanks,
@Aso.agile
python python-2.7 openmpi
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 (*/Python27Libsite-packagesmpi4pylib) following libraries exist: libmpi.lib, libmpi_cxx.lib, libopen-pal.lib, and libopen-rte.lib. Now in my codes when trying to import it:
from mpi4py import MPI
It returns following error:
ImportError: DLL load failed: The specified module could not be found. I tried to copy a bove lib files alongside the */Python27Libsite-packagesmpi4pyMPI.pyd and even to Windows/System32, but it didn't work. I appreciate your help on what DLL is missing and how to fix the error?
Thanks,
@Aso.agile
python python-2.7 openmpi
python python-2.7 openmpi
edited Dec 23 '12 at 12:37
asked Dec 22 '12 at 16:23
Aso Agile
142412
142412
*.lib are either static library archives or import libraries. These are definitely not DLLs.
– Hristo Iliev
Dec 23 '12 at 9:16
Thanks @HristoIliev for your comment.You right *.lib are static library which in this case OpenMPI is provided in form of. Then what DLL is missing?
– Aso Agile
Dec 23 '12 at 12:40
Sorry, never used mpi4py, lest on Windows. Check the installation directory. May be there is a bitness mismatch (there were some Windows installation problems discussed recently on the Open MPI mailing lists...)
– Hristo Iliev
Dec 23 '12 at 20:50
add a comment |
*.lib are either static library archives or import libraries. These are definitely not DLLs.
– Hristo Iliev
Dec 23 '12 at 9:16
Thanks @HristoIliev for your comment.You right *.lib are static library which in this case OpenMPI is provided in form of. Then what DLL is missing?
– Aso Agile
Dec 23 '12 at 12:40
Sorry, never used mpi4py, lest on Windows. Check the installation directory. May be there is a bitness mismatch (there were some Windows installation problems discussed recently on the Open MPI mailing lists...)
– Hristo Iliev
Dec 23 '12 at 20:50
*.lib are either static library archives or import libraries. These are definitely not DLLs.
– Hristo Iliev
Dec 23 '12 at 9:16
*.lib are either static library archives or import libraries. These are definitely not DLLs.
– Hristo Iliev
Dec 23 '12 at 9:16
Thanks @HristoIliev for your comment.You right *.lib are static library which in this case OpenMPI is provided in form of. Then what DLL is missing?
– Aso Agile
Dec 23 '12 at 12:40
Thanks @HristoIliev for your comment.You right *.lib are static library which in this case OpenMPI is provided in form of. Then what DLL is missing?
– Aso Agile
Dec 23 '12 at 12:40
Sorry, never used mpi4py, lest on Windows. Check the installation directory. May be there is a bitness mismatch (there were some Windows installation problems discussed recently on the Open MPI mailing lists...)
– Hristo Iliev
Dec 23 '12 at 20:50
Sorry, never used mpi4py, lest on Windows. Check the installation directory. May be there is a bitness mismatch (there were some Windows installation problems discussed recently on the Open MPI mailing lists...)
– Hristo Iliev
Dec 23 '12 at 20:50
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
Use sys.prefixlibsite-packagesmpi4pybinpython-mpi.exe
or add the following code to sys.prefixlibsite-packagesmpi4py__init__.py
around line 37:
def _init_openmpi():
"""Pre-load libmpi.dll and register OpenMPI distribution."""
import os
import ctypes
if os.name != 'nt' or 'OPENMPI_HOME' in os.environ:
return
try:
openmpi_home = os.path.abspath(os.path.dirname(__file__))
openmpi_bin = os.path.join(openmpi_home, 'bin')
os.environ['OPENMPI_HOME'] = openmpi_home
os.environ['PATH'] = ';'.join((openmpi_bin, os.environ['PATH']))
ctypes.cdll.LoadLibrary(os.path.join(openmpi_bin, 'libmpi.dll'))
except Exception:
pass
_init_openmpi()
I tried this, I added the code both before before and after thedef get_include():
function, but it doesn't work. I don't quite get the first solution you propose.
– Toke Faurby
Jul 10 at 11:45
This answer is long obsolete. It applies to a 5 year old binary of mpi4py that was linked to OpenMPI.
– cgohlke
Jul 11 at 6:47
Makes sense, but do you have an idea as to how to fix it now?
– Toke Faurby
Jul 11 at 10:15
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Use sys.prefixlibsite-packagesmpi4pybinpython-mpi.exe
or add the following code to sys.prefixlibsite-packagesmpi4py__init__.py
around line 37:
def _init_openmpi():
"""Pre-load libmpi.dll and register OpenMPI distribution."""
import os
import ctypes
if os.name != 'nt' or 'OPENMPI_HOME' in os.environ:
return
try:
openmpi_home = os.path.abspath(os.path.dirname(__file__))
openmpi_bin = os.path.join(openmpi_home, 'bin')
os.environ['OPENMPI_HOME'] = openmpi_home
os.environ['PATH'] = ';'.join((openmpi_bin, os.environ['PATH']))
ctypes.cdll.LoadLibrary(os.path.join(openmpi_bin, 'libmpi.dll'))
except Exception:
pass
_init_openmpi()
I tried this, I added the code both before before and after thedef get_include():
function, but it doesn't work. I don't quite get the first solution you propose.
– Toke Faurby
Jul 10 at 11:45
This answer is long obsolete. It applies to a 5 year old binary of mpi4py that was linked to OpenMPI.
– cgohlke
Jul 11 at 6:47
Makes sense, but do you have an idea as to how to fix it now?
– Toke Faurby
Jul 11 at 10:15
add a comment |
up vote
2
down vote
accepted
Use sys.prefixlibsite-packagesmpi4pybinpython-mpi.exe
or add the following code to sys.prefixlibsite-packagesmpi4py__init__.py
around line 37:
def _init_openmpi():
"""Pre-load libmpi.dll and register OpenMPI distribution."""
import os
import ctypes
if os.name != 'nt' or 'OPENMPI_HOME' in os.environ:
return
try:
openmpi_home = os.path.abspath(os.path.dirname(__file__))
openmpi_bin = os.path.join(openmpi_home, 'bin')
os.environ['OPENMPI_HOME'] = openmpi_home
os.environ['PATH'] = ';'.join((openmpi_bin, os.environ['PATH']))
ctypes.cdll.LoadLibrary(os.path.join(openmpi_bin, 'libmpi.dll'))
except Exception:
pass
_init_openmpi()
I tried this, I added the code both before before and after thedef get_include():
function, but it doesn't work. I don't quite get the first solution you propose.
– Toke Faurby
Jul 10 at 11:45
This answer is long obsolete. It applies to a 5 year old binary of mpi4py that was linked to OpenMPI.
– cgohlke
Jul 11 at 6:47
Makes sense, but do you have an idea as to how to fix it now?
– Toke Faurby
Jul 11 at 10:15
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Use sys.prefixlibsite-packagesmpi4pybinpython-mpi.exe
or add the following code to sys.prefixlibsite-packagesmpi4py__init__.py
around line 37:
def _init_openmpi():
"""Pre-load libmpi.dll and register OpenMPI distribution."""
import os
import ctypes
if os.name != 'nt' or 'OPENMPI_HOME' in os.environ:
return
try:
openmpi_home = os.path.abspath(os.path.dirname(__file__))
openmpi_bin = os.path.join(openmpi_home, 'bin')
os.environ['OPENMPI_HOME'] = openmpi_home
os.environ['PATH'] = ';'.join((openmpi_bin, os.environ['PATH']))
ctypes.cdll.LoadLibrary(os.path.join(openmpi_bin, 'libmpi.dll'))
except Exception:
pass
_init_openmpi()
Use sys.prefixlibsite-packagesmpi4pybinpython-mpi.exe
or add the following code to sys.prefixlibsite-packagesmpi4py__init__.py
around line 37:
def _init_openmpi():
"""Pre-load libmpi.dll and register OpenMPI distribution."""
import os
import ctypes
if os.name != 'nt' or 'OPENMPI_HOME' in os.environ:
return
try:
openmpi_home = os.path.abspath(os.path.dirname(__file__))
openmpi_bin = os.path.join(openmpi_home, 'bin')
os.environ['OPENMPI_HOME'] = openmpi_home
os.environ['PATH'] = ';'.join((openmpi_bin, os.environ['PATH']))
ctypes.cdll.LoadLibrary(os.path.join(openmpi_bin, 'libmpi.dll'))
except Exception:
pass
_init_openmpi()
edited Jan 8 '13 at 15:47
answered Jan 8 '13 at 15:23
cgohlke
7,62012424
7,62012424
I tried this, I added the code both before before and after thedef get_include():
function, but it doesn't work. I don't quite get the first solution you propose.
– Toke Faurby
Jul 10 at 11:45
This answer is long obsolete. It applies to a 5 year old binary of mpi4py that was linked to OpenMPI.
– cgohlke
Jul 11 at 6:47
Makes sense, but do you have an idea as to how to fix it now?
– Toke Faurby
Jul 11 at 10:15
add a comment |
I tried this, I added the code both before before and after thedef get_include():
function, but it doesn't work. I don't quite get the first solution you propose.
– Toke Faurby
Jul 10 at 11:45
This answer is long obsolete. It applies to a 5 year old binary of mpi4py that was linked to OpenMPI.
– cgohlke
Jul 11 at 6:47
Makes sense, but do you have an idea as to how to fix it now?
– Toke Faurby
Jul 11 at 10:15
I tried this, I added the code both before before and after the
def get_include():
function, but it doesn't work. I don't quite get the first solution you propose.– Toke Faurby
Jul 10 at 11:45
I tried this, I added the code both before before and after the
def get_include():
function, but it doesn't work. I don't quite get the first solution you propose.– Toke Faurby
Jul 10 at 11:45
This answer is long obsolete. It applies to a 5 year old binary of mpi4py that was linked to OpenMPI.
– cgohlke
Jul 11 at 6:47
This answer is long obsolete. It applies to a 5 year old binary of mpi4py that was linked to OpenMPI.
– cgohlke
Jul 11 at 6:47
Makes sense, but do you have an idea as to how to fix it now?
– Toke Faurby
Jul 11 at 10:15
Makes sense, but do you have an idea as to how to fix it now?
– Toke Faurby
Jul 11 at 10:15
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f14004457%2ferror-loading-mpi-dll-in-mpi4py%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
*.lib are either static library archives or import libraries. These are definitely not DLLs.
– Hristo Iliev
Dec 23 '12 at 9:16
Thanks @HristoIliev for your comment.You right *.lib are static library which in this case OpenMPI is provided in form of. Then what DLL is missing?
– Aso Agile
Dec 23 '12 at 12:40
Sorry, never used mpi4py, lest on Windows. Check the installation directory. May be there is a bitness mismatch (there were some Windows installation problems discussed recently on the Open MPI mailing lists...)
– Hristo Iliev
Dec 23 '12 at 20:50