Error: install fenics on Ubuntu 22.04.3

mhh@mhh-virtual-machine:~ python3 -c "import fenics" Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'fenics' mhh@mhh-virtual-machine:~

Take each line of what is in the docker file, remove the &&\ on every line, and run them sequentially, ie

RUN apt-get update &&\
    apt-get install -y software-properties-common && \
    add-apt-repository ppa:fenics-packages/fenics && \
    apt-get update &&\
    apt-get install -y fenics

Becomes

apt-get update
apt-get install -y software-properties-common
add-apt-repository ppa:fenics-packages/fenics
apt-get update
apt-get install -y fenics

I run these commands. then, I have opened Pycharm, but when I run the code I face this error:
/usr/bin/python3.10 /home/mhh/Downloads/11heatSinkPCM-main/heatSinkPCM-main/heatSinkPCM-main/TOPCMheatsink.py
/home/mhh/.local/lib/python3.10/site-packages/matplotlib/projections/init.py:63: UserWarning: Unable to import Axes3D. This may be due to multiple versions of Matplotlib being installed (e.g. as a system package and as a pip package). As a result, the 3D projection is not available.
warnings.warn("Unable to import Axes3D. This may be due to multiple versions of "
Unknown ufl object type FiniteElement
Traceback (most recent call last):
File “/home/mhh/Downloads/11heatSinkPCM-main/heatSinkPCM-main/heatSinkPCM-main/TOPCMheatsink.py”, line 97, in
V0 = FunctionSpace(mesh, “DG”, 0) # Discontinous function space
File “/usr/lib/petsc/lib/python3/dist-packages/dolfin/function/functionspace.py”, line 33, in init
self._init_convenience(*args, **kwargs)
File “/usr/lib/petsc/lib/python3/dist-packages/dolfin/function/functionspace.py”, line 100, in _init_convenience
self._init_from_ufl(mesh, element, constrained_domain=constrained_domain)
File “/usr/lib/petsc/lib/python3/dist-packages/dolfin/function/functionspace.py”, line 42, in _init_from_ufl
ufc_element, ufc_dofmap = ffc_jit(element, form_compiler_parameters=None,
File “/usr/lib/petsc/lib/python3/dist-packages/dolfin/jit/jit.py”, line 50, in mpi_jit
return local_jit(*args, **kwargs)
File “/usr/lib/petsc/lib/python3/dist-packages/dolfin/jit/jit.py”, line 100, in ffc_jit
return ffc.jit(ufl_form, parameters=p)
File “/home/mhh/.local/lib/python3.10/site-packages/ffc/jitcompiler.py”, line 214, in jit
kind, module_name = compute_jit_prefix(ufl_object, parameters)
File “/home/mhh/.local/lib/python3.10/site-packages/ffc/jitcompiler.py”, line 156, in compute_jit_prefix
error(“Unknown ufl object type %s” % (ufl_object.class.name,))
File “”, line 1, in
File “/home/mhh/.local/lib/python3.10/site-packages/ufl/log.py”, line 172, in error
raise self._exception_type(self._format_raw(*message))
Exception: Unknown ufl object type FiniteElement

Process finished with exit code 1

You do not have the correct version of ufl installed.

Please uninstall the local ufl installation

Please, how can I uninstall the local ufl installation?

I have uninstalled as shown here:
hh@mhh-virtual-machine:~ pip uninstall ufl WARNING: Skipping ufl as it is not installed. mhh@mhh-virtual-machine:~ pip uninstall fenics-ufl
Found existing installation: fenics-ufl 2019.1.0
Uninstalling fenics-ufl-2019.1.0:
Would remove:
/home/mhh/.local/lib/python3.10/site-packages/fenics_ufl-2019.1.0.dist-info/*
/home/mhh/.local/lib/python3.10/site-packages/ufl/*
Proceed (Y/n)? y
Successfully uninstalled fenics-ufl-2019.1.0
mhh@mhh-virtual-machine:~$

But I face this error:
I have uninstalled as shown:
mhh@mhh-virtual-machine:~ pip uninstall fenics-ufl Found existing installation: fenics-ufl 2019.1.0 Uninstalling fenics-ufl-2019.1.0: Would remove: /home/mhh/.local/lib/python3.10/site-packages/fenics_ufl-2019.1.0.dist-info/* /home/mhh/.local/lib/python3.10/site-packages/ufl/* Proceed (Y/n)? y Successfully uninstalled fenics-ufl-2019.1.0 mhh@mhh-virtual-machine:~

But I face this error:
mhh@mhh-virtual-machine:~ pip uninstall fenics-ufl Found existing installation: fenics-ufl 2019.1.0 Uninstalling fenics-ufl-2019.1.0: Would remove: /home/mhh/.local/lib/python3.10/site-packages/fenics_ufl-2019.1.0.dist-info/* /home/mhh/.local/lib/python3.10/site-packages/ufl/* Proceed (Y/n)? y Successfully uninstalled fenics-ufl-2019.1.0 mhh@mhh-virtual-machine:~

You should not reinstall fenics-ufl. It comes with the apt-Get installation