Error installing Fenics for python

I am not sure why you want to install DOLFIN from source, when it is available as docker images, on conda, through apt-get (ubuntu) and various other ways (including spack).

If you want to install from source, you need to install all other dependencies as well, including Eigen3, petsc etc.

Please also note that DOLFIN is not recommended for new users, see; The new DOLFINx solver is now recommended over DOLFIN for details