The Argentina playmaker has been linked with a move away from the Nou Camp this week following a row with Barca club director Eric Abidal.
But Guardiola, who worked with Messi at Barca and still considers himself as a fan of the Spanish club, cannot see an exit materialising.
On the rumours, Guardiola said: “He is a player for Barcelona and he will stay there. That is my wish.
“I am not going to talk about players from other clubs. I think he is going to finish his career there.”
Guardiola is unsure how long Raheem Sterling will be sidelined for.
He said: “It’s a hamstring injury. It takes weeks, but I don’t know (how long) right now.
“It is a problem being without him but we were without Gundo (Ilkay Gundogan) in the first season and (Aymeric) Laporte this season. It is what it is.”
City winger Leroy Sane is back in training after a lengthy injury.
Guardiola said: “He has started to train with us. He needs to recover tempo and confidence. It needs time. He needs weeks.”
City, who host struggling West Ham on Sunday, are 22 points behind Premier League leaders Liverpool.
Guardiola said: “We cannot deny the gap is big. We didn’t expect to be 22 points behind. But it’s the reality. We have to accept it and learn from it.”