The most common cause of constipation in toddlers is diet.
From WebMD:
The culprit in many cases of toddler constipation is a diet that's too heavy in processed foods and sweets, and too light in fiber (like whole grains, fruits, and vegetables). Not getting enough fluid can also lead to constipation, because it makes the stools harder. Any change in diet -- such as when your toddler transitions from breast milk or formula to cow's milk or starts eating new foods -- can also affect the stools.
Limiting especially constipating food like cheese and bananas especially can help. Adding additional liquids (water, juice, watermelon) and high fiber foods can help. Try adding prunes or plum juice, pears, raisins, etc. At 1 1/2 using babyfood pureeed versions of some of these items may be a good option. If keeping an eye on your toddler's diet and steering it in a better direction alone is not enough to relieve chronic constipation, your pediatrician may recommend a fiber supplement or stool softener.