The first candidate to enter the 2019 race for mayor of Chicago on Tuesday became one of the first to exit — with a parting shot at Kanye West and his mayoral candidate Amara Enyia.

Troy LaRaviere, president of the Chicago Principals and Administrators Association, said he’s dropping out because he was unable to gather the 12,500 signatures needed to get on the ballot despite the “amazing” job done by his volunteers.

“Unfortunately, however, it appears we’re going to come up short. The responsibility for this is ultimately my own,” LaRaviere wrote on his campaign website.

“With two weeks left in the petition process, it would require more money than we’ve been able to raise in an entire year. We would also require a massive influx of organized petitioners, just to give us a shot at reaching a signature threshold that would survive the aggressive challenge our petitions are going to get from political insiders from the more well-funded campaigns. Then, of course, there are the legal costs of defending ourselves from that legal challenge.”

LaRaviere then goes on to talk about the “test of my integrity” that occurred when he was contacted by the staff of an “entertainment mogul and hip-hop artist” who had “recently come out as an avid and bombastic supporter” of President Donald Trump. The staff wanted to arrange a meeting with the entertainer.

The entertainment mogul was Kanye, who has since donated $200,000 to Enyia, following the lead of his friend and collaborator, Chance the Rapper.

“I accepted the meeting so I could tell him face-to-face that I could not accept his support as long as he aligned himself with a singularly corrupt President who poisons our culture with divisive racist and sexist proclamations every other time he opens his mouth,” LaRaviere wrote.

LaRaviere said he told West’s staffers that, if West wanted to meet, he “needed to come to my space . . . Symbolically I could not move toward a Trump supporter; if he wanted to talk, he needed to move toward me.”

West’s camp, “must have sensed my reluctance because they eventually stopped reaching out for the meeting,” LaRaviere wrote.

“My campaign needed a lot of money, and I was presented with an opportunity to get a multimillionaire behind us. Still, I chose not to pursue his support,” LaRaviere wrote.

“People are corrupted through one questionable decision at a time. If you campaign to launch a war on corruption — but then look the other way in order to accept support from questionable sources — then you’ve taken the first step toward becoming the corruption you once sought to end. You may win the election, but you’ve lost the war. In fact, you’ve switched sides in that war whether you realize it or not.”

LaRaviere then takes a thinly-veiled shot at Enyia, who has accepted Kanye’s support while acknowledging their political differences.

“I could not associate my campaign or my name with a man who had aligned himself with a president as racist, as corrupt, and as dangerous as Donald Trump. To paraphrase Omar Little, a man has to have a code,” he wrote.

Enyia said she understands the disappointment LaRaviere must feel after starting a campaign he couldn’t finish.

But she said there “no selling out” involved in the $200,000 she has accepted from Kanye.

“The statements about Kanye seem to be outdated because Kanye was very clear about distancing himself from Trump and never supporting his policies,” Enyia said.

“But more importantly, he supported our platform, which Kanye believes was progressive and what the city needed….There’s no selling out. And we weren’t asked to do anything for the support.”

In his exit letter to supporters, LaRaviere noted that he entered the race when Rahm Emanuel “was believed to be on his way to a third term,” only to have Emanuel pull the plug on his own re-election bid in early September.

“I’ve never backed down from a fight, even when it seemed impossible. Even when I had everything to lose,” LaRaviere wrote.

“Brave voices who were not afraid to speak truth to power are responsible for forcing the mayor from the race. I am proud to be one of them.”