The earthquake in Datianba was at the depth of 10 kms, the China Earthquake Networks Centre (CENC) said.
No casualties were reported, an official told state-run Xinhua news agency.
The Yunnan Provincial Earthquake Administration activated an emergency response after the earthquake and dispatched a 20-member working team to the worst-hit area.
Mountainous Yunnan is prone to quakes.
A 6.5-magnitude quake hit Ludian County on August 3 last year, killing more than 600 people.
This week, a powerful 7.5 earthquake that jolted Afghanistan, Pakistan and India was also strongly felt in parts of northwest China's Xinjiang Uygur Autonomous Region.