At best, "smarty pants" has a teasing element to it, so it is certainly not a compliment to teachers or older people! It actually means something more like "so you think you're smart", and shouldn't be read literally.
Do a bit of googling and you'll find the term has been always used negatively.