Error Server at 172.24.16.71:27017 reports wire version 2, but this version of PyMongo requires at least 6 (MongoDB 3.6)

Hi @asmita_magdum and welcome to the forums.

MongoDB 2.6.2 is absolutely vintage and very definitely end of life. You should plan upgrading immediately.

But to answer your question PyMongo 3.12.0 was the last version to support 2.6 PyMongo 4.0 dropped support for MongoDB 3.4 and earlier.