This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

How to run FEniCS programs on Windows?

0 votes

I have instaled FEniCS Windows version (http://fenicsproject.org/download/windows_details.html) but when I simply open any of demo files with Python IDLE, I can not run it (ImportError: No module named dolfin).

My question is: how to run FEniCS programs on Windows?

asked Jul 12, 2013 by arasi FEniCS Novice (150 points)
edited Jul 13, 2013 by arasi

1 Answer

0 votes
 
Best answer

Add something like c:\path_to_fenics\lib\python2.7\site-packages to PYTHONPATH environment variable.

answered Jul 13, 2013 by Jan Blechta FEniCS Expert (51,420 points)
selected Jul 25, 2013 by Jan Blechta

I have updated PYTHONPATH but when I try to run a demo, I get the following error:

C:\>set PYTHONPATH=;C:\FEniCS\lib\site-packages

C:\>C:\FEniCS\lib\Python26\python.exe demo.py
Traceback (most recent call last):
  File "demo.py", line 23, in <module>
    from dolfin import *
  File "C:\FEniCS\lib\site-packages\dolfin\__init__.py", line 23, in <module>
    from dolfin.cppimports import *
  File "C:\FEniCS\lib\site-packages\dolfin\cppimports.py", line 4, in <module>
    import dolfin.cpp as cpp
  File "C:\FEniCS\lib\site-packages\dolfin\cpp.py", line 28, in <module>
    _cpp = swig_import_helper()
  File "C:\FEniCS\lib\site-packages\dolfin\cpp.py", line 24, in swig_import_help
er
    _mod = imp.load_module('_cpp', fp, pathname, description)
ImportError: DLL load failed: ...

What is the rest of the error message after ImportError: DLL load failed:?

The rest sounds like "The module did not found" (it is written in my mother tongue, I don't know how it sounds in English). Nothing special...

Ok, you're missing some other environment variables. For example LD_LIBRARY_PATH is needed in linux but I don't know how is it in windows.

There is some terminal launcher prepared by the FEniCS installer, isn't it? Try if it works. Then investigate which variables it sets.

Yes, there is terminal luncher. But I don't know how to investigate which variables it sets...

I have downloaded and successfully installed FreeFem++. It seems that it works!

I like Python so I would like to try FEniCS. I already installed VirtualBox and tried to install Ubuntu. But during Ubuntu installation problem with root directory which I don't know how to solve has arised ("there is no root directory" or something similar)...

I think that more detailed FEniCS installation tutorial (including how to install Ubuntu on Windows) would be very useful for beginners.

Yes, there is terminal luncher. But I don't know how to investigate which variables it sets...

Launch this terminal. Check if FEniCS works. Investigate environment by

import os
print os.environ

Then update your WIDLE environment accordingly.

I like Python so I would like to try FEniCS. I already installed VirtualBox and tried to install Ubuntu. But during Ubuntu installation problem with root directory which I don't know how to solve has arised ("there is no root directory" or something similar)...

Refer to Ubuntu support.

I think that more detailed FEniCS installation tutorial (including how to install Ubuntu on Windows) would be very useful for beginners.

For solving real problems FEniCS must be compiled against many external libraries. This typically requires manual installation from source even on Ubuntu. This is sufficiently documented and supported here or on mailing-list but requires minimal programming enthusiasm from users.

On the other hand installation on Windows is tangential issue and currently only outdated version of FEniCS is available as precompiled binary for Windows. Please, realize also that you want support of how to import library in your WIDLE, not how to install FEniCS.

You also cannot expect that the mathematical community developing/using finite element library would support installation of Ubuntu on Windows - this is absolutely unrelated.

...