In Pyrol, the lone pair of electron of N is delocalized because it is an aromatic compound. Hence lone pair is the part of the sextet. this means that these electrons are very stable right where they are ( in the aromatic system), and are less available for bonding to proton for these reasons pyrrole nitrogens are not strongly basic
On other hands, aniline is also aromatic but the lone pair of electrons of NH2 group in aniline is delocalized over the benzene ring, it is not involved in aromatization. This lone pair is still available for proton, hence Aniline is the stronger base than Pyrrole.