After deleting everything from .local/lib
you may want to have a look at the installation line I have in the first code cell of Install fenics-shells - #11 by francesco-ballarin , as (for instance) it should help you replacing all instances of ufl
with ufl_legacy
.