Constipation that lasts several weeks or longer can be a sign of a medical condition that requires treatment.