How do i resolve this issue of MixedElement in google colab

Exception Traceback (most recent call last)

in <cell line: 8>()
62 P2 = dolfin.VectorElement(“CG”, mesh.ufl_cell(), 2)
63 TH = dolfin.MixedElement([P2, P1])
—> 64 W = dolfin.FunctionSpace(mesh, TH)
65
66 # define other spaces

7 frames

/usr/local/lib/python3.10/dist-packages/ufl/log.py in error(self, *message)
170 “Write error message and raise an exception.”
171 self._log.error(*message)
→ 172 raise self._exception_type(self._format_raw(*message))
173
174 def begin(self, *message):

Exception: Unknown ufl object type MixedElement

Note: I’m using FEniCS 2019.1.0.

Please clarify how you installed FEniCS on Colab.

If you used FEM on Colab, I purposely disabled ufl because of Announcement: ufl_legacy and legacy dolfin, so you must ufl_legacy instead of ufl.

i used the command:
!pip install fenics

Please use Packages — FEM on Colab instead

Thank you very much. The recommended approach of using the Packages — FEM on Colab worked.

The recommended approach of using the Packages — FEM on Colab worked.