  We consider simultaneous explanations of the electron and muon $g-2$
anomalies through a single $Z'$ of a $U(1)'$ extension to the Standard Model
(SM). We first perform a model-independent analysis of the viable
flavour-dependent $Z'$ couplings to leptons, which are subject to various
strict experimental constraints. We show that only a narrow region of parameter
space with an MeV-scale $Z'$ can account for the two anomalies. Following the
conclusions of this analysis, we then explore the ability of different classes
of $Z'$ models to realise these couplings, including the SM$+U(1)'$, the
$N$-Higgs Doublet Model$+U(1)'$, and a Froggatt-Nielsen style scenario. In each
case, the necessary combination of couplings cannot be obtained, owing to
additional relations between the $Z'$ couplings to charged leptons and
neutrinos induced by the gauge structure, and to the stringency of neutrino
scattering bounds. Hence, we conclude that no $U(1)'$ extension can resolve
both anomalies unless other new fields are also introduced. While most of our
study assumes the Caesium $(g-2)_e$ measurement, our findings in fact also hold
in the case of the Rubidium measurement, despite the tension between the two.
