How to Solve NameError: name 'MongoClient' is not defined -- pymongo

Solution: Import the 'MongoClient' module

To Solve the error, add the following line to the top of your code.

from pymongo import MongoClient

 

For more information:
Python pymongo MongoClient