Ubuntu/Mint repository version is broked

Hi all,

First of all, thanks for one of the best FE sovers I have ever seen… and this is from a 20-years ANSYS Man.

Have just had to reinstall due to a Spyder bug. Fixed … well worked around, by downgrading. However when I used the usually very steady fenics on Ubuntu, viz.: from the ppa:fenics-packages/fenics
I found that it reports the following error on import into:
from fenics import *
Traceback (most recent call last):

File “/tmp/ipykernel_63318/1076205780.py”, line 1, in
from fenics import *

File “/usr/lib/python3/dist-packages/fenics/init.py”, line 7, in
from dolfin import *

File “/usr/lib/petsc/lib/python3/dist-packages/dolfin/init.py”, line 144, in
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
from ufl.form import sub_forms_by_domain

ImportError: cannot import name ‘sub_forms_by_domain’ from ‘ufl.form’ (/usr/local/lib/python3.8/dist-packages/ufl/form.py)

This is most odd as I have a couple of virtual boxed (one Ubuntu 20.04.3 LTS and the Other Linux Mint 20.2) both which were set up in September which work brilliantly.

Any help would be much appreciated, I have spent about 3 hours this morning trying to get to the bottom of it, though to no avail.

Best wishes,

Justin

Hi Justin, your ufl error reports a local installation of ufl. You’ll want to remove that and ensure the system is using the Ubuntu (PPA) packages.

1 Like