Challenges with UFL Library Version Compatibility in FEniCS Installation on Different Ubuntu Versions

I tried to install FEniCS on both Ubuntu versions 22.04 and 23.04, but I encountered an issue with the UFL library in both cases, , which you can also see my issue in this post:UFL Library Errors with Indexed Expressions
When I obtained the versions of FEniCS components, I noticed that the version of UFL is different from the other components, as you can see below.
fenics-digitso == 2019.2.0.dev0
fenics-dolfin == 2019.2.0.dev0
fenics-ffc == 2019.2.0.dev0
fenics-fiat == 2019.2.0.dev0
fenics-ufl-legacy == 2022.3.0
Is this the same for everyone, or has there been an issue with my installation?

this combination of packages seems correct to me.

I have the same on my system (Ubuntu 22.04):

Shell command:

python3 -c "import ufl_legacy as ufl; import dolfin; print(f'dolfin version: {dolfin.__version__}'); print(f'ufl version: {ufl.__version__}')"

returns this:

dolfin version: 2019.2.0.dev0
ufl version: 2022.3.0
1 Like

If you have issues make sure that you are using the ufl-legacy package with legacy fenics.
The new ufl (without the legacy postfix) is meant to work with dolfinx not dolfin (fenics).

At the top of the program you need to overload the ufl with ufl-legacy like this e.g.:

from fenics import *
import ufl_legacy as ufl

# your FEM code follows

Check this post:

1 Like