MongoKit “ImportError: No module named objectid ” error

徘徊边缘 提交于 2019-12-01 04:53:11

It's an error in the dependencies. As of PyMongo 1.11 objectid lives in the bson module, not pymongo.

As Electro said, it's a Bug.

I used the following dirty little hack to keep my site running until it is fixed:

import sys
import pymongo
import bson.objectid
pymongo.objectid = bson.objectid
sys.modules["pymongo.objectid"] = bson.objectid
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!