Is only providing punishments sufficient to stop child rape?

Whenever a child rapist get punished we feel happy, we convince ourselves that the society gets rid of that monster. But, is it really so?