Alvarez, who is tied for second in the American League with 37 home runs, rolled his ankle running out of the box on a single in the first inning.
He looked to be in some pain as he jogged to first base and was checked on briefly by manager Dusty Baker and a trainer before remaining in the game. Serving as the designated hitter on Tuesday, he struck out in the third inning before being replaced by pinch-hitter David Hensley for his at-bat in the fifth.
Baker said X-rays were negative and that Alvarez should be OK in a couple of days.
"We just thought it was better to take him out and look after him," Baker said.
The Astros, who have already won the AL West title, moved within one win or one loss by the New York Yankees of securing home-field advantage through the AL playoffs.
The Associated Press contributed to this report.