Gosh @Maxiash - I've been on Anastrozole for just over 5 years & have never had constipation. That would have been very unpleasant. Everyone reacts differently to different meds, as @iserbrown says. I was on Letrozole and Exemestane prior to that and I had the 'normal' side effects - mainly joint aches & pains & insomnia, which is why I changed to Anastrozole. I've had much less side effects on Anastrozole.
Did you go back onto it (or another AI) after your surgery? Have you had continued constipation?
Had you changed your diet regime at all? As with any changes, if they last for a fair while (or keep coming back) it might be worth asking your specialist if you can have a bowel sample tested ....
take care & all the best