Constipation has no single cause. Some people do not get enough fiber in their diet. For others, constipation may be caused by certain medicines, such as opiates (used to control pain) or ondansetron (used to control nausea and vomiting). Constipation can also be caused by certain medical conditions, such as multiple sclerosis or Parkinson disease. Constipation can come and go. Sometimes it can last for weeks, months, or years. This is called chronic constipation.