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

ModuleNotFoundError: No module named 'ufl' #19

Open
jyk816108 opened this issue May 23, 2024 · 1 comment
Open

ModuleNotFoundError: No module named 'ufl' #19

jyk816108 opened this issue May 23, 2024 · 1 comment

Comments

@jyk816108
Copy link

Hi, I use docker to run this project,
docker pull ghcr.io/computationalphysiology/cbcbeat:v2023.2.0
docker run -it ghcr.io/computationalphysiology/cbcbeat:v2023.2.0

A error has arisen when I run demo_biventricular.py through Docker,

python3 ./demo_biventricular.py

The returned content is as follows:
Traceback (most recent call last):
File "/app/demo/bidomain-biventricular/./demo_biventricular.py", line 270, in
main()
File "/app/demo/bidomain-biventricular/./demo_biventricular.py", line 192, in main
application_parameters = setup_application_parameters()
File "/app/demo/bidomain-biventricular/./demo_biventricular.py", line 55, in setup_application_parameters
info(application_parameters, True)
File "/usr/lib/python3/dist-packages/ufl_legacy/log.py", line 121, in info
self.log(INFO, *message)
File "/usr/lib/python3/dist-packages/ufl_legacy/log.py", line 108, in log
text = self._format_raw(*message)
File "/usr/lib/python3/dist-packages/ufl_legacy/log.py", line 225, in _format_raw
return message[0] % message[1:]
TypeError: unsupported operand type(s) for %: 'dolfin.cpp.parameter.Parameters' and 'tuple'

**So I deleted this line of code:**info(application_parameters, True)
**but another error arises,

The returned content is as follows:**
Setting up application parameters
Setting up cardiac model
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Traceback (most recent call last):
File "/app/demo/bidomain-biventricular/./demo_biventricular2.py", line 270, in
main()
File "/app/demo/bidomain-biventricular/./demo_biventricular2.py", line 197, in main
(heart, gs) = setup_cardiac_model(application_parameters)
File "/app/demo/bidomain-biventricular/./demo_biventricular2.py", line 160, in setup_cardiac_model
(M_i, M_e, gs) = setup_conductivities(mesh, application_parameters)
File "/app/demo/bidomain-biventricular/./demo_biventricular2.py", line 106, in setup_conductivities
from ufl import diag
ModuleNotFoundError: No module named 'ufl'

@finsberg
Copy link
Member

You need to change the import from

import ufl

to

import ufl_legacy as ufl

Note that I plan to move most of the functionality from cbcbeat to fenics-beat (https://github.com/finsberg/fenics-beat), including the bidomain solver, but bidomain is not my main priority at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants