Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEniCS is not working #4

Closed
BenjaminRodenberg opened this issue Feb 22, 2021 · 9 comments · Fixed by #22
Closed

FEniCS is not working #4

BenjaminRodenberg opened this issue Feb 22, 2021 · 9 comments · Fixed by #22
Labels
bug Something isn't working

Comments

@BenjaminRodenberg
Copy link
Member

I tried running tutorials/HT/partitioned-heat/fenics-fenics and got an error:

$ python3 heat.py
...
ModuleNotFoundError: No module named 'fenics'
@BenjaminRodenberg BenjaminRodenberg added the bug Something isn't working label Feb 22, 2021
@MakisH
Copy link
Member

MakisH commented Feb 22, 2021

FEniCS is installed in the develop branch. Please try again and close. :)

@BenjaminRodenberg BenjaminRodenberg changed the title FEniCS is not installed FEniCS is not working Feb 22, 2021
@BenjaminRodenberg
Copy link
Member Author

I checked the current version from develop and now we get the following error:

vagrant@precicevm:~/Desktop$ python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import fenics
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/fenics/__init__.py", line 7, in <module>
    from dolfin import *
  File "/usr/lib/petsc/lib/python3/dist-packages/dolfin/__init__.py", line 144, in <module>
    from .fem.assembling import (assemble, assemble_system, assemble_multimesh, assemble_mixed,
  File "/usr/lib/petsc/lib/python3/dist-packages/dolfin/fem/assembling.py", line 38, in <module>
    from ufl.form import sub_forms_by_domain
ImportError: cannot import name 'sub_forms_by_domain' from 'ufl.form' (/home/vagrant/.local/lib/python3.8/site-packages/ufl/form.py)
>>> 

This is a good old friend of mine: See precice/fenics-adapter#103 and especially https://fenicsproject.discourse.group/t/installing-python-package-with-fenics-dependency-breaks-fenics-installation/4476. I would suggest implementing the fix from the forum post directly in the vm.

I already tried this manually in the vm and it seems to work:

vagrant@precicevm:~/Desktop$ pip3 uninstall -y fenics-ufl
Found existing installation: fenics-ufl 2019.1.0
Uninstalling fenics-ufl-2019.1.0:
  Successfully uninstalled fenics-ufl-2019.1.0
vagrant@precicevm:~/Desktop$ python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import fenics
>>> 

Let's keep this issue open. Problem has slightly shifted, but is still there.

@MakisH
Copy link
Member

MakisH commented Feb 22, 2021

I am already doing this, so I am confused:

pip3 uninstall -y fenics-ufl

@BenjaminRodenberg
Copy link
Member Author

I am already doing this, so I am confused:

pip3 uninstall -y fenics-ufl

Hmm... this also brings for me a new layer of confusion into precice/fenics-adapter#103.

@vidanovic
Copy link

The same problem here:

from fenics import *

ModuleNotFoundError: No module named 'fenics'

@BenjaminRodenberg
Copy link
Member Author

The same problem here:

from fenics import *

ModuleNotFoundError: No module named 'fenics'

@vidanovic As far as I understand the history of our current release (https://github.com/precice/vm/releases/tag/v202211.0.0), the fix from #64 is not included yet. Can you try to uninstall fenics-ufl as described above? (I'm assuming you are using v202211.0.0)

@vidanovic
Copy link

@BenjaminRodenberg Yes, I have tried to uninstall fenics-ufl and it did not help. Will try later when this is fixed.
Best!

@MakisH
Copy link
Member

MakisH commented Jul 18, 2023

@vidanovic we are not planning any release of the vm (even a bugfix) till the next preCICE Distribution (which will come after preCICE v3 is released, not before summer). Do you need this fix released soon?

@vidanovic
Copy link

@MakisH No, it is not urgent at all. It was more of a test against some of the equations I am developing in my FEM engine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants