Constipated

I’m 9 weeks pp and for the last 3 weeks I’ve randomly been constipated. No clue why, my stomach doesn’t hurt but I do have a lot of gas. When I go I’m only able to get a little bit out. Has anybody had that?