The nature of doping anions in polymerization solution has great influences on structure and properties of electro-polymerized polypyrrole (PPy) films and, thereby, on the electrocatalytic activity for I−/I3− redox reaction and accordingly the performance of dye-sensitized solar cells (DSSCs) based on PPy counter electrodes (CEs). The ions of chloride (Cl−), sulfate (SO42−), p-toluene sulfonate (TsO−), and dodecyl benzene sulfonate (DBS−) have been used as counter anions to prepare PPy films as CEs in the DSSCs. Compared with inorganic anions (Cl− and SO42−), the organic ones (TsO− and DBS−) afford more delocalized polarons. Moreover, PPy–DBS− films have the most fibrous or porous structure. Thus, PPy–DSB− has plenty of electrocatalytic active sites and high electric conductivity and, thereby, high electrocatalytic activity for I−/I3− redox reaction. Due to the synergistic effects of fibrous/porous structure, high conductivity and low interfacial charge transfer impedance, PPy–DBS− CE based DSSCs show the best photovoltaic conversion efficiency up to 5.40%, reaching 88% of the DSSCs based on Pt CE. Our results indicate that PPy thin films are promising candidates to replace Pt as the CEs for DSSCs, especially for the future flexible devices.