Personal tools
You are here: Home Forum Use import of libMEDMEM_Swig on Windows

import of libMEDMEM_Swig on Windows

Up to Use

import of libMEDMEM_Swig on Windows

Posted by Philippe Leveque at September 21. 2012

Hello,

 

On Linux, I can use the MEDMEM python API using "import libMEDMEM_Swig" in a python script.

 

I try to do the same on Windows (XP, 32 bit) using the Salome distribution "SALOME-6.5.0-WIN32-DEV-RELEASE" but it fails.

 

 

I run the following batch :

 

@ECHO OFF

SET LD_LIBRARY_PATH=C:\SALOME-6.5.0-WIN32-DEV-RELEASE\PRODUCTS\med-3.0.5\lib

SET LD_LIBRARY_PATH=%LD_LIBRARY_PATH%;C:\SALOME-6.5.0-WIN32-DEV-RELEASE\PRODUCTS\hdf5-1.8.8\lib

SET LD_LIBRARY_PATH=%LD_LIBRARY_PATH%;C:\SALOME-6.5.0-WIN32-DEV-RELEASE\PRODUCTS\hdf5-1.8.8\dll

SET LD_LIBRARY_PATH=%LD_LIBRARY_PATH%;C:\SALOME-6.5.0-WIN32-DEV-RELEASE\MODULES\MED\RELEASE\MED_INSTALL\lib\salome

ECHO %LD_LIBRARY_PATH%

SET pycmd="import sys;sys.path.append('C:\SALOME-6.5.0-WIN32-DEV-RELEASE\MODULES\MED\RELEASE\MED_INSTALL\lib\python2.6\site-packages\salome');import libMEDMEM_Swig"

python -c %pycmd%

 

And the log is :

 

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "C:\SALOME-6.5.0-WIN32-DEV-RELEASE\MODULES\MED\RELEASE\MED_INSTALL\lib\python2.6\site-packages\salome\libMEDMEM_Swig.py", line 25, in <module>

    _libMEDMEM_Swig = swig_import_helper()

  File "C:\SALOME-6.5.0-WIN32-DEV-RELEASE\MODULES\MED\RELEASE\MED_INSTALL\lib\python2.6\site-packages\salome\libMEDMEM_Swig.py", line 21, in swig_import_helper

    _mod = imp.load_module('_libMEDMEM_Swig', fp, pathname, description)

ImportError: DLL load failed: Le module spécifié est introuvable.

 

If I open _libMEDMEM_Swig.dll with Dependency Walker, it tells me that somme dll are missing : hdf5dll.dll, medc.dll, medmem.dll, msvcr90.dll, msjava.dll

 

Any idea ?

 

PhL

 

 

Re: import of libMEDMEM_Swig on Windows

Posted by Philippe Leveque at September 27. 2012

Previously Philippe Leveque wrote:

Hello,

 

On Linux, I can use the MEDMEM python API using "import libMEDMEM_Swig" in a python script.

 

I try to do the same on Windows (XP, 32 bit) using the Salome distribution "SALOME-6.5.0-WIN32-DEV-RELEASE" but it fails.

 

 

I run the following batch :

 

@ECHO OFF

SET LD_LIBRARY_PATH=C:\SALOME-6.5.0-WIN32-DEV-RELEASE\PRODUCTS\med-3.0.5\lib

SET LD_LIBRARY_PATH=%LD_LIBRARY_PATH%;C:\SALOME-6.5.0-WIN32-DEV-RELEASE\PRODUCTS\hdf5-1.8.8\lib

SET LD_LIBRARY_PATH=%LD_LIBRARY_PATH%;C:\SALOME-6.5.0-WIN32-DEV-RELEASE\PRODUCTS\hdf5-1.8.8\dll

SET LD_LIBRARY_PATH=%LD_LIBRARY_PATH%;C:\SALOME-6.5.0-WIN32-DEV-RELEASE\MODULES\MED\RELEASE\MED_INSTALL\lib\salome

ECHO %LD_LIBRARY_PATH%

SET pycmd="import sys;sys.path.append('C:\SALOME-6.5.0-WIN32-DEV-RELEASE\MODULES\MED\RELEASE\MED_INSTALL\lib\python2.6\site-packages\salome');import libMEDMEM_Swig"

python -c %pycmd%

 

And the log is :

 

Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "C:\SALOME-6.5.0-WIN32-DEV-RELEASE\MODULES\MED\RELEASE\MED_INSTALL\lib\python2.6\site-packages\salome\libMEDMEM_Swig.py", line 25, in <module>

    _libMEDMEM_Swig = swig_import_helper()

  File "C:\SALOME-6.5.0-WIN32-DEV-RELEASE\MODULES\MED\RELEASE\MED_INSTALL\lib\python2.6\site-packages\salome\libMEDMEM_Swig.py", line 21, in swig_import_helper

    _mod = imp.load_module('_libMEDMEM_Swig', fp, pathname, description)

ImportError: DLL load failed: Le module spécifié est introuvable.

 

If I open _libMEDMEM_Swig.dll with Dependency Walker, it tells me that somme dll are missing : hdf5dll.dll, medc.dll, medmem.dll, msvcr90.dll, msjava.dll

 

Any idea ?

 

PhL

 

 

Well, the path of the 3 libraries (hdf5, med and MEM) need also to be in the PATH environment variable.

PhL

 

 

Powered by Ploneboard
Document Actions