Alterations of gut microbiome have been proposed to play a role in metabolic disease, but the major determinants of microbiota composition remain ill defined. Nutritional and sex hormone challenges, especially during early development, have been shown to permanently alter adult female phenotype and contribute to metabolic disturbances. In this study, we implemented large-scale microbiome analyses to fecal samples from groups of female rats sequentially subjected to various obesogenic manipulations, including sex hormone perturbations by means of neonatal androgenization or adult ovariectomy (OVX), as a model of menopause, to establish whether these phenomena are related to changes in gut microbiota. Basic metabolic profiles concerning glucose/insulin homeostasis were also explored. The effects of the sex hormonal perturbations, either developmentally (androgenization) or in adulthood (OVX), clearly outshone the impact of nutritional interventions, especially concerning the gut microbiota profile. Notably, we observed a lower diversity in the androgenized group, with the highest Firmicutes to Bacteroidetes ratio, supporting the occurrence of durable alterations in gut microbiota composition, even in adulthood. Moreover, the elimination of adult ovarian secretions by OVX affected the richness of gut microbiota. Our data are the first to document the durable impact of sex steroid manipulations, and particularly early androgenization, on gut microbiota composition. Such dysbiosis is likely to contribute to the metabolic perturbations of conditions of obesity linked to gonadal dysfunction in the female.