Dolfin demo crashes - "failed to import module" error message

Asked by Timu Gallien

I have Fenics installed on Windows Vista but am unable to run the demo programs. The module which the demo is looking for is present in 'C:\Users\Timu\.instant\cache', but the program does not seem to recognize they are there. Does anyone have suggestions?

C:\FEniCS\share\dolfin\demo\pde\navier-stokes\python>python demo.py
Computing mesh connectivity 2 - 2.
Computing mesh connectivity 0 - 2.
Creating mesh entities of dimension 1.
In instant.import_module_directly: Failed to import module 'form_fbe9250706cbb74
636c7c77012477c3a794e8927' from 'C:\Users\Timu\.instant\cache'.
Failed to import module found in cache. Modulename: 'form_fbe9250706cbb74636c7c7
7012477c3a794e8927'; Path: 'C:\Users\Timu\.instant\cache'.
Traceback (most recent call last):
  File "demo.py", line 22, in <module>
    V = VectorFunctionSpace(mesh, "CG", 2)
  File "C:\FEniCS\lib\site-packages\dolfin\function\functionspace.py", line 315,
 in __init__
    restriction=restriction)]
  File "C:\FEniCS\lib\site-packages\dolfin\function\functionspace.py", line 231,
 in __init__
    FunctionSpaceBase.__init__(self, mesh, element)
  File "C:\FEniCS\lib\site-packages\dolfin\function\functionspace.py", line 44,
in __init__
    ufc_element, ufc_dofmap = jit(self._ufl_element)
  File "C:\FEniCS\lib\site-packages\dolfin\compilemodules\jit.py", line 47, in m
pi_jit
    return local_jit(*args, **kwargs)
  File "C:\FEniCS\lib\site-packages\dolfin\compilemodules\jit.py", line 114, in
jit
    return jit_compile(form, parameters=p, common_cell=common_cell)
  File "C:\FEniCS\lib\site-packages\ffc\jitcompiler.py", line 62, in jit
    return jit_element(object, parameters)
  File "C:\FEniCS\lib\site-packages\ffc\jitcompiler.py", line 162, in jit_elemen
t
    (compiled_form, module, form_data) = jit_form(form, parameters)
  File "C:\FEniCS\lib\site-packages\ffc\jitcompiler.py", line 113, in jit_form
    module = instant.import_module(jit_object, cache_dir=cache_dir)
  File "C:\FEniCS\lib\site-packages\instant\cache.py", line 155, in import_modul
e
    return check_disk_cache(modulename, cache_dir, moduleids)
  File "C:\FEniCS\lib\site-packages\instant\cache.py", line 121, in check_disk_c
ache
    module = import_and_cache_module(path, modulename, moduleids)
  File "C:\FEniCS\lib\site-packages\instant\cache.py", line 67, in import_and_ca
che_module
    instant_assert(module is not None, "Failed to import module found in cache.
Modulename: '%s'; Path: '%s'." % (modulename, path))
  File "C:\FEniCS\lib\site-packages\instant\output.py", line 55, in instant_asse
rt
    raise AssertionError(text)
AssertionError: Failed to import module found in cache. Modulename: 'form_fbe925
0706cbb74636c7c77012477c3a794e8927'; Path: 'C:\Users\Timu\.instant\cache'.

C:\FEniCS\share\dolfin\demo\pde\navier-stokes\python>

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Johan Hake (johan-hake) said :
#1

Coud you open a command prompt and:

  cd C:\Users\Timu\.instant\cache
  python -c "import form_fbe9250706cbb74 636c7c77012477c3a794e8927"

and report the problem you have.

Johan

On Wednesday January 12 2011 12:56:17 Timu Gallien wrote:
> New question #141219 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/141219
>
> I have Fenics installed on Windows Vista but am unable to run the demo
> programs. The module which the demo is looking for is present in
> 'C:\Users\Timu\.instant\cache', but the program does not seem to recognize
> they are there. Does anyone have suggestions?
>
>
> C:\FEniCS\share\dolfin\demo\pde\navier-stokes\python>python demo.py
> Computing mesh connectivity 2 - 2.
> Computing mesh connectivity 0 - 2.
> Creating mesh entities of dimension 1.
> In instant.import_module_directly: Failed to import module
> 'form_fbe9250706cbb74 636c7c77012477c3a794e8927' from
> 'C:\Users\Timu\.instant\cache'.
> Failed to import module found in cache. Modulename:
> 'form_fbe9250706cbb74636c7c7 7012477c3a794e8927'; Path:
> 'C:\Users\Timu\.instant\cache'.
> Traceback (most recent call last):
> File "demo.py", line 22, in <module>
> V = VectorFunctionSpace(mesh, "CG", 2)
> File "C:\FEniCS\lib\site-packages\dolfin\function\functionspace.py", line
> 315, in __init__
> restriction=restriction)]
> File "C:\FEniCS\lib\site-packages\dolfin\function\functionspace.py", line
> 231, in __init__
> FunctionSpaceBase.__init__(self, mesh, element)
> File "C:\FEniCS\lib\site-packages\dolfin\function\functionspace.py", line
> 44, in __init__
> ufc_element, ufc_dofmap = jit(self._ufl_element)
> File "C:\FEniCS\lib\site-packages\dolfin\compilemodules\jit.py", line 47,
> in m pi_jit
> return local_jit(*args, **kwargs)
> File "C:\FEniCS\lib\site-packages\dolfin\compilemodules\jit.py", line
> 114, in jit
> return jit_compile(form, parameters=p, common_cell=common_cell)
> File "C:\FEniCS\lib\site-packages\ffc\jitcompiler.py", line 62, in jit
> return jit_element(object, parameters)
> File "C:\FEniCS\lib\site-packages\ffc\jitcompiler.py", line 162, in
> jit_elemen t
> (compiled_form, module, form_data) = jit_form(form, parameters)
> File "C:\FEniCS\lib\site-packages\ffc\jitcompiler.py", line 113, in
> jit_form module = instant.import_module(jit_object, cache_dir=cache_dir)
> File "C:\FEniCS\lib\site-packages\instant\cache.py", line 155, in
> import_modul e
> return check_disk_cache(modulename, cache_dir, moduleids)
> File "C:\FEniCS\lib\site-packages\instant\cache.py", line 121, in
> check_disk_c ache
> module = import_and_cache_module(path, modulename, moduleids)
> File "C:\FEniCS\lib\site-packages\instant\cache.py", line 67, in
> import_and_ca che_module
> instant_assert(module is not None, "Failed to import module found in
> cache. Modulename: '%s'; Path: '%s'." % (modulename, path))
> File "C:\FEniCS\lib\site-packages\instant\output.py", line 55, in
> instant_asse rt
> raise AssertionError(text)
> AssertionError: Failed to import module found in cache. Modulename:
> 'form_fbe925 0706cbb74636c7c77012477c3a794e8927'; Path:
> 'C:\Users\Timu\.instant\cache'.
>
> C:\FEniCS\share\dolfin\demo\pde\navier-stokes\python>

Revision history for this message
Timu Gallien (tgallien) said :
#2

Hello Johan:

DLL Load failed. Please see screen output below.

Thank you,

Timu

C:\Users\Timu\.instant\cache>python -c "import form_fbe9250706cbb74636c7c7701247
7c3a794e8927"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "form_fbe9250706cbb74636c7c77012477c3a794e8927\__init__.py", line 1, in <
module>
    from form_fbe9250706cbb74636c7c77012477c3a794e8927 import *
  File "form_fbe9250706cbb74636c7c77012477c3a794e8927\form_fbe9250706cbb74636c7c
77012477c3a794e8927.py", line 28, in <module>
    _form_fbe9250706cbb74636c7c77012477c3a794e8927 = swig_import_helper()
  File "form_fbe9250706cbb74636c7c77012477c3a794e8927\form_fbe9250706cbb74636c7c
77012477c3a794e8927.py", line 24, in swig_import_helper
    _mod = imp.load_module('_form_fbe9250706cbb74636c7c77012477c3a794e8927', fp,
 pathname, description)
ImportError: DLL load failed: Invalid access to memory location.

Revision history for this message
Johan Hake (johan-hake) said :
#3

I am not a Windows user and have never seen that error so I do nto have any
more suggestions...

You might want to google:

  ImportError: DLL load failed: Invalid access to memory location

I did but could not imediately pick a path to take.

Johan

On Wednesday January 12 2011 14:13:18 Timu Gallien wrote:
> Question #141219 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/141219
>
> Status: Answered => Open
>
> Timu Gallien is still having a problem:
> Hello Johan:
>
> DLL Load failed. Please see screen output below.
>
> Thank you,
>
> Timu
>
> C:\Users\Timu\.instant\cache>python -c "import
> form_fbe9250706cbb74636c7c7701247 7c3a794e8927"
> Traceback (most recent call last):
> File "<string>", line 1, in <module>
> File "form_fbe9250706cbb74636c7c77012477c3a794e8927\__init__.py", line 1,
> in < module>
> from form_fbe9250706cbb74636c7c77012477c3a794e8927 import *
> File
> "form_fbe9250706cbb74636c7c77012477c3a794e8927\form_fbe9250706cbb74636c7c
> 77012477c3a794e8927.py", line 28, in <module>
> _form_fbe9250706cbb74636c7c77012477c3a794e8927 = swig_import_helper()
> File
> "form_fbe9250706cbb74636c7c77012477c3a794e8927\form_fbe9250706cbb74636c7c
> 77012477c3a794e8927.py", line 24, in swig_import_helper
> _mod =
> imp.load_module('_form_fbe9250706cbb74636c7c77012477c3a794e8927', fp,
> pathname, description)
> ImportError: DLL load failed: Invalid access to memory location.

Revision history for this message
Johannes Ring (johannr) said :
#4

Did you run the command suggested by Johan in a regular command prompt or in the FEniCS "Command Shell" found under the start menu? The latter is the only way it will work, unless you set up the correct environment variables by yourself.

Please try to run instant-clean in the "Command Shell" and then run the demo program again. If it fails, please also try out some of the other demos, like the poisson demo (both C++ and Python version).

Revision history for this message
Theo Lau (theodorl) said :
#5

I ran into a similar, if not identical problem. I followed the suggestions in this thread and basically ended up with the same results. even "instant-clean" did not yield results. was this problem solved and how?

thanks
-theo lau

Revision history for this message
Johannes Ring (johannr) said :
#6

@Theo: I guess there are still conflicts with your Python 2.5 installation. I'm not sure how to resolve this, but I may try to reproduce the problem tomorrow.

Revision history for this message
Johannes Ring (johannr) said :
#7

@Theo: The problem can be your LIBRARY_PATH variable as you reported in question #143006:

  LIBRARY_PATH=C:\Program Files\g95\lib;C:\Program Files\g95\lib\gcc-lib\i686-pc-mingw32\4.0.4

This could result in that the wrong gcc library will be used when the Python extension modules are created. Try to unset this variable as you did with PYTHONHOME and then rerun the demo. It might be necessary to run instant-clean first.

Revision history for this message
Theo Lau (theodorl) said :
#8

thanks. that solved the problem.

Can you help with this problem?

Provide an answer of your own, or ask Timu Gallien for more information if necessary.

To post a message you must log in.