I got the same error Microsoft SharePoint Server 2013 encountered an error during setup,

[![enter image description here][1]][1]


In my situation, the underlying issue stemmed from utilizing only a single processor core for my Hyper-V setup when installing SharePoint. 

> For more details, Please check [Microsoft SharePoint Server 2016
> encountered an error during setup][2]


  [1]: https://i.sstatic.net/MojkB.png
  [2]: https://spgeeks.devoworx.com/sharepoint-server-2016-encountered-an-error/