Not long ago, an outsider came to Washington to be president of the United States. He ran as an anti-politician, a man who was not going to play politicians’ tawdry games. Washington was broken and he had solutions to fix it.

His political party, which ruled both chambers of Congress, did not much know him. His campaign against Washington felt like an attack on them. But, this outsider seemed better than the person the other party ran, despite that individual being very experienced at governance. So, the legislators mustered up smiles and tried to make the best of the situation. Maybe they could score a few wins together early on, they hoped.

Their effort to work with the new president turned sour quickly. He knew few people in the Swamp, and he staffed his team with other outsiders, who antagonized Congress with their high-handedness. The president and national legislature locked horns often, and struggled to get anything done.

The reader would be forgiven for not realizing the president being discussed above is Jimmy Carter.

Today we are seeing a strikingly similar story play out. The first seven months of President Donald J. Trump’s term have passed, and he lacks a signature legislative achievement. He is struggling to keep his big campaign promises. Obamacare has not been repealed and replaced with something better. The tax code has not been reformed.

Many of the policy actions the president has taken have been of a negative nature, like pulling out of the Trans-Pacific Partnership. Fifteen of the 45 pieces of legislation Trump has signed struck down Obama-era regulations. And Trump was forced to sign the Russia sanctions act despite objecting to it. (As for the rest of those laws, they are a grab bag of mostly small beer, like naming federal buildings and enacting small reforms to existing programs.)

Donald Trump is new to politics and new to Washington. He previously was a donor to Democrats and liberal causes, and registered as a Republican right before he made his astonishing presidential run. He ran a campaign that horrified many Democrats, and offended legion Republicans.

All of which means President Trump has few friends and supporters on Capitol Hill. Democrats, certainly, have no interest in lending the new president a hand. Best to let him fall on his face, and maybe drag the GOP down with him in the 2018 midterm elections.

So Trump really needed Republicans to back him, but with great alacrity he appalled and offended them. Before being elected, he feuded with House Speaker Paul Ryan, R-Wisconsin. Jeff Sessions, who left his Senate seat to help Trump, found himself rewarded with a public browbeating from the president for daring to follow U.S. Justice Department guidelines on conflicts of interest. Now the president and his team are openly feuding with Sen. Mitch McConnell, R-Kentucky, who leads the other chamber that Trump needs to pass his legislation.

Republicans facing re-election this year or next might well begin distancing themselves from the increasingly unpopular Trump. Only 37 percent of Americans approve of Trump’s handling of the job, barely 200 days into it. That’s the same amount of public affection Jimmy Carter had when his little-loved, one-term presidency concluded.

Jimmy Carter was a one-term president, in great part, due to his refusal to recognize a basic truth: getting things done in Washington requires making friends — especially in the Capitol’s high places — and cutting deals. Presidential power is limited, and few lasting policy achievements come through executive orders. Landmark policies come from laws, which require most legislators to vote aye. Congressmen value their votes, and they will not give them to someone who berates them.

Will Trump’s presidency end after four years as Carter’s did? Quite possibly. He is well on his way.