An aspect of a rotary
electric machine of the disclosure includes: a rotor, able to rotate about a central axis as a center; a
stator, opposite to the rotor, with a gap being interposed between the rotor and the
stator; a substrate, electrically connected with the
stator; a first housing, formed of
metal, being open on a side in an axial direction, and accommodating the stator; a second housing, fixed, on the side in the axial direction, to the first housing, accommodating the substrate, and having an insulating property; and a conductor, electrically connected with the substrate and the first housing. The substrate has a grounding pattern. The conductor has: a first connector, electrically connected with the first housing inside the first housing; and a second connector, electrically connected with the grounding pattern.