Pyrite is a common sulfide mineral in gold deposits, and its unique thermoelectricity has received extensive attention in the field of gold exploration. However, there is still a lack of detailed research and direct evidence about how impurity elements affect mineral semiconductor properties. In this paper, combined with first-principles calculations, laser ablation inductively coupled plasma mass spectrometry (LA-ICP-MS) mapping technology and in situ Seebeck coefficient scanning probe technology were used to study the law of changing semiconductor properties in pyrite containing impurity elements such as As, Co, Ni, and Cu. The results showed that pyrite containing arsenic is a P-type semiconductor, and pyrites containing Ni, Co, Cu, and other elements are N-type semiconductors. When P-type pyrites containing As were supplemented with Ni, Cu, and other elements, the semiconductor type changed to N-type. However, Co addition did not change the semiconductor type of arsenic-rich pyrite. Pyrite formed under different temperature conditions tended to be enriched with different combinations of impurity elements, leading to the relative accumulation of P-type or N-type pyrites.