In the early days of PV cells NEG (Net energy gained) of their production was actually below 1. Today it is above 1 but no-one knows by how much as the effective productive life of a PV cell is not known. The most modern estimate is that after 2 years service a PV cell has equalled the energy required to manufacture and install it.
This summation (2 years of service of PV use equals amount of energy used to manufacture it) of course doesn't take into consideration the historical evolution in research and infrastructure required and related to development of PV technology, mineral refinement and extraction, technological and economic viability of associated supply industries and plant required to manufacture PV. Let alone the massive costs associated with educating, transporting and supporting the humans that are needed to make PV.
We have PV cells because we have a fossil-fuel economy. Without oil, we never would have discovered PV, because the social economic culture that has enabled industry, research and levels of education to soar to the point where we could develop PV technology would never have existed in the first place.
The formulation below assumes a factory to build PV is in place and a truckload of refined silica is sitting in drums waiting to be turned into PV cells by someone with a priori knowledge about how to build them. All this with no prior consideration of how all that stuff got to be there in the first place.
And this assumption, totally devoid of any holistic knowledge about the nature of why our society exists in it's present form is this precisely the problem.