我遇到了这个错误,我也安装了flask-pymongo库,但它仍然显示错误,我尝试了很多不同的方法,但是当我使用它时,它还是同样的错误。有没有办法解决它。我也在下面分享我的代码。
from flask import Flask
from flask_pymongo import PyMongo
from bson.json_util import dumps
from bson.objectid import ObjectId
from flask import jsonify, request
from werkzeug.security import generate_password_hash, check_password_hash
app = Flask(__name__)
app.secret_key = "secretkey"
app.config['MONGO_URI'] = "mongodb://localhost:27017/Users"
mongo = PyMongo(app)
if __name__ == "__main__":
app.run(debug=True)