This invention relates to indolizine derivatives and their use in medicine. In particular, the present invention discloses novel substituted indolizine derivatives of formula I, or an isotopically labeled compound thereof, or an optical isomer thereof, a geometric isomer thereof, a tautomer thereof or a mixture of various isomers, or a pharmaceutically acceptable salt thereof, or a prodrug thereof. The invention also relates to the use of these compounds in medicine.