The England international, 25, limped out of his club’s 2-0 defeat at Tottenham on Sunday.
“It takes weeks, but I don’t know how long right now,” Guardiola said.
Second-placed City, who are 22 points behind leaders Liverpool, confirmed that scans had revealed damage to Sterling’s left hamstring.
Sterling has featured in 23 of City’s 25 league matches this season.
“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,” Guardiola added on Friday.
It was better news on City winger Leroy Sane, who is back in training after suffering a serious knee injury in the Community Shield against Liverpool on 4 August.
“He has started to train with us. He needs to recover tempo and confidence,” the City manager confirmed. “It needs time. He needs weeks.”