In the beginning there was Eliot, who was followed by Anthony, and now there is Eric — each in his day a superstar rising, and each now irrevocably framed in the rearview mirror of New York politics.

Blame hubris. Blame hormones. Blame the New York way — which attracts and rewards uncommonly arrogant, power-mongering overachievers who lack both boundaries and simple common sense.

Eliot Spitzer, as attorney general, stretched law and custom to terrorize Wall Street; he rode that overreach into Albany’s executive chamber — then hid bank transactions to pay a hooker, got caught and left public life in disgrace.

Anthony Weiner was a congressman, a job he meant only to pave the way to an inevitable arrival at Gracie Mansion. But he began exposing himself on the internet, sometimes to children, and today he’s in prison.

Eric Schneiderman, the now-former attorney general, transformed that office into a hyperactive, extra-official ideological enforcement agency, earning unbounded progressive applause along the way — even as he was beating women in private. Schneiderman denies the charges — leveled in The New Yorker — but they are credible, and he is now a private citizen for the first time since 2003.

The end came swiftly for the Upper West Side liberal luminary — he quit scarcely three hours after the magazine detailed the particulars — and who’s to doubt that this all came as a profound shock to him. Perhaps not the substance of the charges, of course — but certainly the accountability.

New York pols aren’t used to answering for their excesses. Yes, the occasional Preet Bharara lumbers along with halting attempts to enforce the criminal codes — with decidedly mixed results. (Still, thank goodness for the effort.)

But apart from the outrageous and egregious — stand up, Anthony Weiner! — high-ranking New York pols generally offend against the spirit of the law, not the letter.

Eliot Spitzer’s Sheriff of Wall Street schtick — he bludgeoned targets into submission, rarely gaining actual convictions — was a highly personal abuse of power. It was outside of all previous understanding of the limits if his office, it was solely intended to make him governor — and it worked.

Eric Schneiderman used Spitzer’s template as a starting point — suing corporate America for personal political gain and in the end all but declaring legal war on the Trump administration. He too was a serial abuser of power, as well as of women, but who is to doubt that he would have become governor as well? Save for #MeToo?

Such things happen in one-party, low-voter-turnout political environments. While violations of the penal code can attract attention — witness the stream of thieving state legislators entering prison over the past decade — there is no natural check on those who do violence to the spirit of democratic self-government. To the rule of law.

Worse than that, New York voters love it. Both Spitzer and Schneiderman were wildly popular incumbents. And Weiner was well on his way to becoming mayor in 2013 until he flashed his iPhone one more time and started calling himself Carlos Danger.

So no surprise, then, that sociopaths are drawn to high office in the Empire State. It’s fertile ground for those inclined to stretch the law to suit their personal interests, and who then are hailed as heroes for doing so.

Thank goodness they usually blow the whistle on themselves. For the system doesn’t much care.

Bob McManus is a contributing editor to the Manhattan Institute’s City Journal.