Vieira was born in Lisbon to Cristóvão Vieira Ravasco, the son of a mulatto woman, and Maria de Azevedo. In 1614 he accompanied his parents to the colony of Brazil, where his father had been posted as a registrar. He received his education at the Jesuit college at Bahia. He entered the Jesuit novitiate in 1625, under Father Fernão Cardim, and two years later pronounced his first vows. At the age of eighteen he was teaching rhetoric, and a little later dogmatic theology, at the college of Olinda, besides writing the "annual letters" of the province.