Carmelo Anthony thought he had been traded twice before he actually was. It was wishful thinking.

During an interview on SiriusXM, Anthony said he was under the impression “a trade was in place’’ with Cleveland and “got called off” on draft night in which both he and Paul George were headed to the Cavaliers. It was unclear whom the Knicks or Pacers were getting back, but ESPN reported it was a five-team deal that fell through when no one wanted Kevin Love.

Anthony also said he was told by his reps earlier this summer “a deal was done’’ with Houston.

According to NBA sources, the Knicks say no deal was done with Houston, but his agents and the Rockets were pressing the Knicks hard to accept their offer, which included Ryan Anderson. The Knicks eventually pulled out of talks altogether as no other club was willing to take Anderson, and his long-term contract didn’t meet the club’s rebuilding plan.

“They were never close to a deal with Houston,’’ an NBA source said. “That’s a fact.’’