How can i solve this error. It will generate while running program.
from bson import ObjectId
class JSONEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, ObjectId):
return str(o)
return json.JSONEncoder.default(self, o)
That's most likely due to version mismatches.
This worked for me:
pip uninstall bson
pip uninstall pymongo
pip install pymongo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With