Cannabis has been known to be used for constipation. Some suggest that hemp seed oil will help and has been used within Chinese medicine. Others suggest that smoking marijuana or using cannabis derived oils or tinctures also help. Around (2,300 B.C.) hemp was actually documented as a medicine.
I am not a doctor but as there are a variety of reasons for constipation, it is probably best to figure out why you have it and go from there. Dehydration, diet sodas, lack of sufficient fiber and opioids are all common factors.
Non cannabis products that are helpful are increasing magnesium intake with supplements, eating more fruits and vegetables, lots of exercise and obviously drinking a lot of water. Unfortunately, if opioids or other medications are causing it, it is more difficult to treat. This is why there is a booming business in anti-constipation medication for the medications that cause it.
This post represents my opinion and research only. I hope this helps.