This is an article in the field of mineral processing engineering. Through single mineral flotation test, solution chemistry calculation, Zeta potential detection, XPS detection, the influence and regulation mechanism of Ca2+ and Mg2+ on the flotation of pyrite at different slurry temperatures was studied. The results showed that the low temperature could significantly inhibit the flotation of pyrite, and also could weaken the inhibitory effect of Ca2+ and Mg2+ on the flotation of pyrite. When the slurry temperature dropped from 20 ℃ to 5 ℃, the speed of movement of the charged particles slowed down, the Zeta potential and the critical pH value for the formation of calcium and magnesium hydroxide increased , and the proportion of FeO/OH on the pyrite surface in pyrite pulp decreased , decreasing the reduction rate of FeO/OH content on the pyrite surface in Ca2+ and Mg2+ pulp, reducing the oxidation sites on the pyrite surface, reducing the adsorption of Ca2+, Ca(OH)+, Mg2+and Mg(OH)+on the pyrite surface. However, the low temperature did not change the existence form and adsorption state of Ca2+ and Mg2+ on the pyrite surface. When the pH value was 9, the calcium and magnesium were adsorbed on the pyrite surface in the form of Ca2+, Ca(OH)+, Mg2+and Mg(OH)+.